[FIX] Horilla Audit: History bug in candidate

This commit is contained in:
Horilla
2024-01-10 09:50:14 +05:30
parent 73bbd7414e
commit 59244a9958

View File

@@ -75,7 +75,7 @@ def get_diff(instance):
new = change.new
field = instance._meta.get_field(change.field)
is_fk = False
if isinstance(field, models.fields.CharField) and field.choices:
if isinstance(field, models.fields.CharField) and field.choices and old and new:
choices = dict(field.choices)
old = choices[old]
new = choices[new]