Skip to content

Commit

Permalink
Don't query fields we don't care about for volunteer stats
Browse files Browse the repository at this point in the history
  • Loading branch information
mhagander committed Nov 5, 2024
1 parent ee8af12 commit 380cbfb
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions postgresqleu/confreg/volsched.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ def send_volunteer_notification(conference, assignment, subject, template):
def _get_volunteer_stats(conference):
stats = ConferenceRegistration.objects.filter(conference=conference) \
.filter(volunteers_set=conference) \
.only('firstname', 'lastname') \
.annotate(num_assignments=Count('volunteerassignment')) \
.annotate(total_time=Sum(Func(
Func(F('volunteerassignment__slot__timerange'), function='upper'),
Expand Down

0 comments on commit 380cbfb

Please sign in to comment.