Fixed #27512 -- Removed unused code in Model.__init__().

This commit is contained in:
Adam Chainz 2016-11-21 00:39:32 +00:00 committed by Tim Graham
parent 9d4246419c
commit 74742aa956
1 changed files with 1 additions and 5 deletions

View File

@ -21,8 +21,7 @@ from django.db.models.constants import LOOKUP_SEP
from django.db.models.deletion import CASCADE, Collector from django.db.models.deletion import CASCADE, Collector
from django.db.models.fields import AutoField from django.db.models.fields import AutoField
from django.db.models.fields.related import ( from django.db.models.fields.related import (
ForeignObjectRel, ManyToOneRel, OneToOneField, lazy_related_operation, ForeignObjectRel, OneToOneField, lazy_related_operation, resolve_relation,
resolve_relation,
) )
from django.db.models.manager import Manager from django.db.models.manager import Manager
from django.db.models.options import Options from django.db.models.options import Options
@ -494,9 +493,6 @@ class Model(six.with_metaclass(ModelBase)):
continue continue
setattr(self, field.attname, val) setattr(self, field.attname, val)
kwargs.pop(field.name, None) kwargs.pop(field.name, None)
# Maintain compatibility with existing calls.
if isinstance(field.remote_field, ManyToOneRel):
kwargs.pop(field.attname, None)
# Now we're left with the unprocessed fields that *must* come from # Now we're left with the unprocessed fields that *must* come from
# keywords, or default. # keywords, or default.