mirror of
https://github.com/jazzband/django-auditlog.git
synced 2026-03-16 22:20:26 +00:00
Reorder condition in get_field_value function: as many people have non-database fields and this will break their code ;)
This commit is contained in:
parent
d412b2b16a
commit
96d3906c81
1 changed files with 1 additions and 1 deletions
|
|
@ -83,7 +83,7 @@ def get_field_value(obj, field):
|
|||
value = json.dumps(value, sort_keys=True, cls=field.encoder)
|
||||
except TypeError:
|
||||
pass
|
||||
elif (field.one_to_one or field.many_to_one) and hasattr(field, "rel_class"):
|
||||
elif hasattr(field, "rel_class") and (field.one_to_one or field.many_to_one):
|
||||
value = smart_str(
|
||||
getattr(obj, field.get_attname(), None), strings_only=True
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in a new issue