diff --git a/model_utils/tracker.py b/model_utils/tracker.py index eab1d4af..1fa4a96f 100644 --- a/model_utils/tracker.py +++ b/model_utils/tracker.py @@ -332,12 +332,12 @@ def _get_field_name(self) -> str: self.instance._deferred_fields = self.instance.get_deferred_fields() for field in self.instance._deferred_fields: - field_obj = self.instance.__class__.__dict__.get(field) + field_obj: models.Field = self.instance.__class__.__dict__[field] if isinstance(field_obj, FileDescriptor): file_descriptor_tracker = FileDescriptorTracker(field_obj.field) setattr(self.instance.__class__, field, file_descriptor_tracker) else: - deferred_attribute_tracker = DeferredAttributeTracker(field) + deferred_attribute_tracker = DeferredAttributeTracker(field_obj) setattr(self.instance.__class__, field, deferred_attribute_tracker)