From 952924f4cf0c9303faa3cf7955737a9f56db45aa Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 9 Oct 2025 10:45:55 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- auditlog/diff.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/auditlog/diff.py b/auditlog/diff.py index a45c38c..a69465c 100644 --- a/auditlog/diff.py +++ b/auditlog/diff.py @@ -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)}