From 6403f3423beb51c4fcacc0134bb415cb1b5d70fb Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 29 Nov 2022 10:43:10 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- auditlog/models.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/auditlog/models.py b/auditlog/models.py index ac968ab7..cda2e39e 100644 --- a/auditlog/models.py +++ b/auditlog/models.py @@ -464,10 +464,13 @@ def changes_display_dict(self): except AttributeError: # if the field is a relationship it has no internal type and exclude it continue - + if field_type == "ManyToManyField": values_display = values - values_display['objects'] = [f"{i[:140]}..." if len(i) >140 else i for i in values['objects'] ] + values_display["objects"] = [ + f"{i[:140]}..." if len(i) > 140 else i + for i in values["objects"] + ] verbose_name = model_fields["mapping_fields"].get( field.name, getattr(field, "verbose_name", field.name) )