From 3efd29f231156f140bc4a0d2beb714281fe727ff Mon Sep 17 00:00:00 2001 From: Balamurali M Date: Thu, 12 Sep 2024 18:38:53 +0530 Subject: [PATCH] fix(HelpdeskSearch): Only index published articles --- helpdesk/search.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/helpdesk/search.py b/helpdesk/search.py index 33052425b..a1a471ac8 100644 --- a/helpdesk/search.py +++ b/helpdesk/search.py @@ -302,7 +302,10 @@ def get_count(self, doctype): def get_records(self, doctype): records = [] - for d in frappe.db.get_all(doctype, fields=self.DOCTYPE_FIELDS[doctype]): + filters = {"published": True} if doctype == "HD Article" else {} + for d in frappe.db.get_all( + doctype, filters=filters, fields=self.DOCTYPE_FIELDS[doctype] + ): d.doctype = doctype if doctype == "HD Article": for heading, section in self.get_sections(d.content):