mirror of
https://github.com/Hopiu/django-model-utils.git
synced 2026-03-16 20:00:23 +00:00
Remove catching of AttributeError in DescriptorWrapper
This catch was introduced in #367, but subsequent discussion in #370, #381 and #382 suggests that it wasn't the proper solution. Now that `AbstractModelTrackerTests` is re-enabled and passing, it becomes clear that `AttributeError` is no longer raised during unit testing when using a recent Django version. Therefore I think it is safe to remove the `try`/`except`.
This commit is contained in:
parent
a6b0a2aff7
commit
14cf1b0d40
1 changed files with 1 additions and 4 deletions
|
|
@ -50,10 +50,7 @@ class DescriptorWrapper:
|
|||
if instance is None:
|
||||
return self
|
||||
was_deferred = self.field_name in instance.get_deferred_fields()
|
||||
try:
|
||||
value = self.descriptor.__get__(instance, owner)
|
||||
except AttributeError:
|
||||
value = self.descriptor
|
||||
value = self.descriptor.__get__(instance, owner)
|
||||
if was_deferred:
|
||||
tracker_instance = getattr(instance, self.tracker_attname)
|
||||
tracker_instance.saved_data[self.field_name] = lightweight_deepcopy(value)
|
||||
|
|
|
|||
Loading…
Reference in a new issue