django-auditlog
django-auditlog copied to clipboard
Comparison of change of Decimal types is flaky, sometimes returns false positive
I was seeing false positives on my decimal fields, where I "changed the value" from .17000 to .17. Why does get_field_value stringify before comparing? I would think most datatypes will compare better if left as their real datatypes, no?
I added this in locally and it seemed happier:
elif isinstance(field, (DecimalField, JSONField)):
try:
value = field.to_python(getattr(obj, field.name, None))
except ObjectDoesNotExist:
value = field.default if field.default is not NOT_PROVIDED else None