mirror of
https://github.com/django/django.git
synced 2025-05-04 22:17:34 +00:00
Removed unnecessary code in Model.__init__().
As is_related_object is True, the val variable is unused for the remainder of the method. Unnecessary since 53da1e47942f22a56e761d786ba89d05ca55a224.
This commit is contained in:
parent
c6581a40be
commit
60dc957a82
@ -457,11 +457,6 @@ class Model(metaclass=ModelBase):
|
|||||||
val = kwargs.pop(field.attname)
|
val = kwargs.pop(field.attname)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
val = field.get_default()
|
val = field.get_default()
|
||||||
else:
|
|
||||||
# Object instance was passed in. Special case: You can
|
|
||||||
# pass in "None" for related objects if it's allowed.
|
|
||||||
if rel_obj is None and field.null:
|
|
||||||
val = None
|
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
val = kwargs.pop(field.attname)
|
val = kwargs.pop(field.attname)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user