diff --git a/django/db/models/query_utils.py b/django/db/models/query_utils.py index 4c6c48bf9d..f7c6d74e72 100644 --- a/django/db/models/query_utils.py +++ b/django/db/models/query_utils.py @@ -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):