]> git.ipfire.org Git - thirdparty/paperless-ngx.git/commitdiff
Fix: dont link related document if document is in the trash
authorshamoon <4887959+shamoon@users.noreply.github.com>
Tue, 3 Dec 2024 03:42:54 +0000 (19:42 -0800)
committershamoon <4887959+shamoon@users.noreply.github.com>
Tue, 3 Dec 2024 03:42:54 +0000 (19:42 -0800)
src/documents/serialisers.py

index 8b1605af9611005175cd8aeade2751618613d8a1..91e291c219535f0c09a1661a01122fbfd731c841 100644 (file)
@@ -1615,7 +1615,11 @@ class TasksViewSerializer(OwnedObjectSerializer):
             case states.SUCCESS:
                 re = self.created_doc_re
             case states.FAILURE:
-                re = self.duplicate_doc_re
+                re = (
+                    self.duplicate_doc_re
+                    if "existing document is in the trash" not in obj.result
+                    else None
+                )
         if re is not None:
             try:
                 result = re.search(obj.result).group(1)