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,7 +147,7 @@ class DeferredAttribute:
|
||||||
val = self._check_parent_chain(instance)
|
val = self._check_parent_chain(instance)
|
||||||
if val is None:
|
if val is None:
|
||||||
instance.refresh_from_db(fields=[field_name])
|
instance.refresh_from_db(fields=[field_name])
|
||||||
val = getattr(instance, field_name)
|
else:
|
||||||
data[field_name] = val
|
data[field_name] = val
|
||||||
return data[field_name]
|
return data[field_name]
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue