From f25062f470b74133fbeef1215fe9e15c9cbcb862 Mon Sep 17 00:00:00 2001 From: techwithalext Date: Thu, 16 May 2024 23:12:30 -0400 Subject: [PATCH] filter CC report wall of shame to just active members --- accounts/views.py | 2 +- site_tmpl/users_shame.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/accounts/views.py b/accounts/views.py index 9010ab18..eaa6e267 100644 --- a/accounts/views.py +++ b/accounts/views.py @@ -356,7 +356,7 @@ def shame(request): on a leaderboard. """ context = {} - worst_cc_report_forgetters = get_user_model().objects.annotate(Count('ccinstances', distinct=True)).annotate( + worst_cc_report_forgetters = get_user_model().objects.filter(groups__name='Active').annotate(Count('ccinstances', distinct=True)).annotate( did_ccreport_count=Count(Case(When(ccinstances__event__ccreport__crew_chief=F('pk'), then=F('ccinstances'))), distinct=True)).annotate( failed_to_do_ccreport_count=(F('ccinstances__count') - F('did_ccreport_count'))).annotate( diff --git a/site_tmpl/users_shame.html b/site_tmpl/users_shame.html index 20ab9f48..d9899998 100644 --- a/site_tmpl/users_shame.html +++ b/site_tmpl/users_shame.html @@ -6,7 +6,7 @@

Hall of Shame

-

Worst at doing CC reports

+

Worst active members at doing CC reports