From da1fb2ff4e9ea75b6e4c31816f6d13c6ed288a9a Mon Sep 17 00:00:00 2001 From: Akhil Narang Date: Tue, 21 Nov 2023 13:01:19 +0530 Subject: [PATCH] fix(event/sync_communication): add `distinct` while querying communication links There's cases where these are duplicated Signed-off-by: Akhil Narang --- frappe/desk/doctype/event/event.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/frappe/desk/doctype/event/event.py b/frappe/desk/doctype/event/event.py index 5463df6413..bf56498780 100644 --- a/frappe/desk/doctype/event/event.py +++ b/frappe/desk/doctype/event/event.py @@ -121,9 +121,7 @@ class Event(Document): ["Communication Link", "link_doctype", "=", participant.reference_doctype], ["Communication Link", "link_name", "=", participant.reference_docname], ] - comms = frappe.get_all("Communication", filters=filters, fields=["name"]) - - if comms: + if comms := frappe.get_all("Communication", filters=filters, fields=["name"], distinct=True): for comm in comms: communication = frappe.get_doc("Communication", comm.name) self.update_communication(participant, communication)