feat: create_auditlog bug
This commit is contained in:
parent
625074049e
commit
94c026f23f
|
@ -37,6 +37,7 @@ def create_auditlog(action: str, instance, val_new: dict, val_old: dict = None,
|
|||
change_user_l = change_user if change_user else instance.update_by
|
||||
change_time_l = change_time if change_time else instance.update_time
|
||||
else:
|
||||
has_changed = True
|
||||
change_user_l = change_user
|
||||
change_time_l = change_time
|
||||
for k, v in val_new.items():
|
||||
|
@ -47,8 +48,6 @@ def create_auditlog(action: str, instance, val_new: dict, val_old: dict = None,
|
|||
elif not compare_values(val_new.get(k), val_old.get(k), ignore_order=True):
|
||||
difference.append(
|
||||
{'field': k, 'action': 'update', 'val_old': val_old[k], 'val_new': v})
|
||||
if difference:
|
||||
has_changed = True
|
||||
if has_changed:
|
||||
AuditLog.objects.create(
|
||||
action=action,
|
||||
|
|
Loading…
Reference in New Issue