fix: filtering for blog category

This commit is contained in:
Shivam Mishra 2019-11-12 18:54:13 +05:30
parent ea3b9cea60
commit e36ad8d8de

View file

@ -145,11 +145,12 @@ def get_blog_category(route):
def get_blog_list(doctype, txt=None, filters=None, limit_start=0, limit_page_length=20, order_by=None):
conditions = []
category = filters.blog_category or sanitize_html(frappe.local.form_dict.blog_category or frappe.local.form_dict.category)
if filters:
if filters.blogger:
conditions.append('t1.blogger=%s' % frappe.db.escape(filters.blogger))
if filters.blog_category:
conditions.append('t1.blog_category=%s' % frappe.db.escape(filters.blog_category))
if category:
conditions.append('t1.blog_category=%s' % frappe.db.escape(category))
if txt:
conditions.append('(t1.content like {0} or t1.title like {0}")'.format(frappe.db.escape('%' + txt + '%')))