From 59244a9958da774d1a2a01349b53ed5eb5038036 Mon Sep 17 00:00:00 2001 From: Horilla Date: Wed, 10 Jan 2024 09:50:14 +0530 Subject: [PATCH] [FIX] Horilla Audit: History bug in candidate --- horilla_audit/methods.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/horilla_audit/methods.py b/horilla_audit/methods.py index 82dc4a216..fd2a5d736 100644 --- a/horilla_audit/methods.py +++ b/horilla_audit/methods.py @@ -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]