mirror of
https://github.com/jazzband/django-auditlog.git
synced 2026-03-16 22:20:26 +00:00
Fix issue where base_field.choices has options but we short circuit on an empty field.choices
This commit is contained in:
parent
a94ca4d5fd
commit
76a4ea0f95
1 changed files with 2 additions and 2 deletions
|
|
@ -259,9 +259,9 @@ class LogEntry(models.Model):
|
|||
values_display = []
|
||||
# handle choices fields and Postgres ArrayField to get human readable version
|
||||
choices_dict = None
|
||||
if hasattr(field, 'choices'):
|
||||
if hasattr(field, 'choices') and len(field.choices) > 0:
|
||||
choices_dict = dict(field.choices)
|
||||
elif hasattr(field, 'base_field') and getattr(field.base_field, 'choices', False):
|
||||
if hasattr(field, 'base_field') and getattr(field.base_field, 'choices', False):
|
||||
choices_dict = dict(field.base_field.choices)
|
||||
|
||||
if choices_dict:
|
||||
|
|
|
|||
Loading…
Reference in a new issue