mirror of
https://github.com/jazzband/django-auditlog.git
synced 2026-03-16 22:20:26 +00:00
Exclude fields with no internal type, e.g. relationships like foreign keys and reverse foreign keys, from the changes_display_dict output.
This commit is contained in:
parent
a98bf9d7a5
commit
6cb9a27dca
1 changed files with 5 additions and 1 deletions
|
|
@ -278,7 +278,11 @@ class LogEntry(models.Model):
|
|||
except:
|
||||
values_display.append(choices_dict.get(value, 'None'))
|
||||
else:
|
||||
field_type = field.get_internal_type()
|
||||
try:
|
||||
field_type = field.get_internal_type()
|
||||
except AttributeError:
|
||||
# if the field is a relationship it has no internal type and exclude it
|
||||
continue
|
||||
for value in values:
|
||||
# handle case where field is a datetime, date, or time type
|
||||
if field_type in ["DateTimeField", "DateField", "TimeField"]:
|
||||
|
|
|
|||
Loading…
Reference in a new issue