mirror of
https://github.com/jazzband/django-auditlog.git
synced 2026-03-16 22:20:26 +00:00
Return None if attribute choices doesn't exist
Related to #273 and #293 Very minimal change that should have no impact on the code other than making sure iterated fields have a .choices attribute.
This commit is contained in:
parent
e2913da1bb
commit
f9158b640f
1 changed files with 1 additions and 1 deletions
|
|
@ -310,7 +310,7 @@ class LogEntry(models.Model):
|
|||
values_display = []
|
||||
# handle choices fields and Postgres ArrayField to get human readable version
|
||||
choices_dict = None
|
||||
if getattr(field, "choices") and len(field.choices) > 0:
|
||||
if getattr(field, "choices", None) and len(field.choices) > 0:
|
||||
choices_dict = dict(field.choices)
|
||||
if (
|
||||
hasattr(field, "base_field")
|
||||
|
|
|
|||
Loading…
Reference in a new issue