Fixed #31680 -- Removed unnecessary getattr() call in DeferredAttribute.__get__().
refresh_from_db() loads fields values.
This commit is contained in:
parent
9bfa6a35f0
commit
678c8dfee4
|
@ -147,8 +147,8 @@ class DeferredAttribute:
|
|||
val = self._check_parent_chain(instance)
|
||||
if val is None:
|
||||
instance.refresh_from_db(fields=[field_name])
|
||||
val = getattr(instance, field_name)
|
||||
data[field_name] = val
|
||||
else:
|
||||
data[field_name] = val
|
||||
return data[field_name]
|
||||
|
||||
def _check_parent_chain(self, instance):
|
||||
|
|
Loading…
Reference in New Issue