mirror of
https://github.com/django/django.git
synced 2025-10-26 23:26:08 +00:00
Fixed #25910 -- Rejected read-only property names in model constructors.
This commit is contained in:
committed by
Tim Graham
parent
4dc74371e3
commit
16baec5c8a
@@ -435,7 +435,8 @@ class Model(six.with_metaclass(ModelBase)):
|
||||
for prop in list(kwargs):
|
||||
try:
|
||||
if isinstance(getattr(self.__class__, prop), property):
|
||||
setattr(self, prop, kwargs.pop(prop))
|
||||
setattr(self, prop, kwargs[prop])
|
||||
del kwargs[prop]
|
||||
except AttributeError:
|
||||
pass
|
||||
if kwargs:
|
||||
|
||||
Reference in New Issue
Block a user