1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #25320 -- Reverted ManyToManyField.null to False for backwards compatibility.

Thanks Tom Christie for the report and review.
This commit is contained in:
Tim Graham
2015-08-28 09:25:54 -04:00
parent 4c30fa905d
commit 064d4b1cb0
4 changed files with 26 additions and 5 deletions

View File

@@ -2304,8 +2304,6 @@ class ManyToManyField(RelatedField):
self.db_table = db_table
self.swappable = swappable
# Many-to-many fields are always nullable.
self.null = True
def check(self, **kwargs):
errors = super(ManyToManyField, self).check(**kwargs)
@@ -2552,7 +2550,6 @@ class ManyToManyField(RelatedField):
def deconstruct(self):
name, path, args, kwargs = super(ManyToManyField, self).deconstruct()
# Handle the simpler arguments.
del kwargs["null"]
if self.db_table is not None:
kwargs['db_table'] = self.db_table
if self.remote_field.db_constraint is not True: