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):