Skip to content

Commit

Permalink
fix(HelpdeskSearch): Only index published articles
Browse files Browse the repository at this point in the history
  • Loading branch information
balamurali27 committed Sep 12, 2024
1 parent 304476d commit 3efd29f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion helpdesk/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 3efd29f

Please sign in to comment.