Skip to content

A community-supported supercharged document management system: scan, index and archive all your documents

Fix: use JSON for note audit log entries (#7650)

shamoone98d52830f57
diff --git a/src/documents/views.py b/src/documents/views.py
index c0ceef4a3..d673809e1 100644
--- a/src/documents/views.py
+++ b/src/documents/views.py
@@ -678,11 +678,9 @@ class DocumentViewSet(
if settings.AUDIT_LOG_ENABLED:
LogEntry.objects.log_create(
instance=doc,
- changes=json.dumps(
- {
- "Note Added": ["None", c.id],
- },
- ),
+ changes={
+ "Note Added": ["None", c.id],
+ },
action=LogEntry.Action.UPDATE,
)
@@ -715,11 +713,9 @@ class DocumentViewSet(
if settings.AUDIT_LOG_ENABLED:
LogEntry.objects.log_create(
instance=doc,
- changes=json.dumps(
- {
- "Note Deleted": [note.id, "None"],
- },
- ),
+ changes={
+ "Note Deleted": [note.id, "None"],
+ },
action=LogEntry.Action.UPDATE,
)