fix: mentor counts on cohort page

The group by clause was missing in the query.

Issue #271
This commit is contained in:
Anand Chitipothu
2021-12-01 12:19:03 +05:30
parent 6c747ff8b4
commit e014c94446

View File

@@ -27,7 +27,8 @@ class Cohort(Document):
q = f"""
SELECT subgroup, count(*) as count
FROM `tab{doctype}`
WHERE cohort = %(cohort)s"""
WHERE cohort = %(cohort)s
GROUP BY subgroup"""
rows = frappe.db.sql(q, values={"cohort": self.name})
return {subgroup: count for subgroup, count in rows}