]> git.ipfire.org Git - thirdparty/paperless-ngx.git/commitdiff
Fix: use JSON for note audit log entries (#7650)
authorshamoon <4887959+shamoon@users.noreply.github.com>
Sat, 7 Sep 2024 23:09:11 +0000 (16:09 -0700)
committerGitHub <noreply@github.com>
Sat, 7 Sep 2024 23:09:11 +0000 (16:09 -0700)
src/documents/views.py

index c0ceef4a384f61d793f38adea5aef2d784ed1b17..d673809e1335e227f0c5e0d95f3657cb888cb8e8 100644 (file)
@@ -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,
                 )