From 5b5d779f256b443f21de5314df4aecec16e489ce Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Wed, 24 Apr 2024 11:27:50 +0530 Subject: [PATCH] fix: certified participants query --- lms/lms/api.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lms/lms/api.py b/lms/lms/api.py index e2597116..3f174d6f 100644 --- a/lms/lms/api.py +++ b/lms/lms/api.py @@ -334,10 +334,11 @@ def get_certified_participants(): LMSCertificate = DocType("LMS Certificate") participants = ( frappe.qb.from_(LMSCertificate) - .select("DISTINCT member") + .select(LMSCertificate.member) + .distinct() .where(LMSCertificate.published == 1) - .order_by("creation desc") - .run() + .orderby(LMSCertificate.creation, order=frappe.qb.desc) + .run(as_dict=1) ) participant_details = []