From 007e5a5473356eabee75c2949c97080d544e020c Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Mon, 2 Dec 2024 19:42:54 -0800 Subject: [PATCH] Fix: dont link related document if document is in the trash --- src/documents/serialisers.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/documents/serialisers.py b/src/documents/serialisers.py index 8b1605af9..91e291c21 100644 --- a/src/documents/serialisers.py +++ b/src/documents/serialisers.py @@ -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)