Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Nov 29, 2022
1 parent b906bc6 commit 6403f34
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions auditlog/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
)
Expand Down

0 comments on commit 6403f34

Please sign in to comment.