mirror of
https://github.com/jazzband/django-auditlog.git
synced 2026-03-16 22:20:26 +00:00
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
ee278edc8f
commit
952924f4cf
1 changed files with 4 additions and 1 deletions
|
|
@ -218,8 +218,11 @@ def model_instance_diff(
|
|||
# and mutate instance._state.fields_cache as a side-effect.
|
||||
# Make this behavior opt-in via AUDITLOG_EXCLUDE_REVERSE_RELATIONS.
|
||||
if settings.AUDITLOG_EXCLUDE_REVERSE_RELATIONS:
|
||||
|
||||
def is_reverse_field(f):
|
||||
return getattr(f, "auto_created", False) and not getattr(f, "concrete", False)
|
||||
return getattr(f, "auto_created", False) and not getattr(
|
||||
f, "concrete", False
|
||||
)
|
||||
|
||||
fields = {f for f in fields if not is_reverse_field(f)}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue