From 9ebdb63976f7e409f9bb81f82f4fa6b8a1936e21 Mon Sep 17 00:00:00 2001 From: Arjuna Del Toso Date: Mon, 28 Oct 2024 23:05:41 -0400 Subject: [PATCH] more_improvements --- auditlog/diff.py | 4 ++-- setup.py | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/auditlog/diff.py b/auditlog/diff.py index 51cf5c3..bd5fe59 100644 --- a/auditlog/diff.py +++ b/auditlog/diff.py @@ -206,10 +206,10 @@ def model_instance_diff( if old_value != new_value: if field.name in custom_fields_callbacks: - old_value = " FIELD TOO LARGE " new_value = custom_fields_callbacks[field.name]( - old_value, new_value + json.dumps(old_value), json.dumps(new_value) ) + old_value = " FIELD TOO LARGE " diff[field.name] = (smart_str(old_value), smart_str(new_value)) elif model_fields and field.name in model_fields["mask_fields"]: diff[field.name] = ( diff --git a/setup.py b/setup.py index 901ab66..5927137 100644 --- a/setup.py +++ b/setup.py @@ -28,7 +28,11 @@ setup( long_description=long_description, long_description_content_type="text/markdown", python_requires=">=3.8", - install_requires=["Django>=3.2", "python-dateutil>=2.7.0"], + install_requires=[ + "Django>=3.2", + "python-dateutil>=2.7.0", + "deepdiff==7.0.*", + ], zip_safe=False, classifiers=[ "Programming Language :: Python :: 3",