From 27103366aaf02b2c8aaed50bced2abaa60fe831c Mon Sep 17 00:00:00 2001 From: Interitio Date: Tue, 2 Sep 2025 21:34:54 +1000 Subject: [PATCH] fix: leaderboard query --- subathon/component.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/subathon/component.py b/subathon/component.py index 443521e..ab938f7 100644 --- a/subathon/component.py +++ b/subathon/component.py @@ -552,10 +552,11 @@ class SubathonComponent(cmds.Component): if (active := await self.get_active_subathon(cid)) is not None: # Get totals for all contributors - query = self.data.subathon_contributions.select_where(subathonid=active.subathondata.subathon_id) + query = self.data.subathon_contributions.select_where(subathon_id=active.subathondata.subathon_id) query.join('user_profiles', using=('profileid',)) - query.select('profileid', total="SUM(score)") + query.select('subathon_id', 'profileid', total="SUM(score)") query.order_by('total', direction=ORDER.DESC) + query.group_by('subathon_id', 'profileid') query.with_no_adapter() results = await query