Skip to content
This repository has been archived by the owner on Nov 6, 2019. It is now read-only.

Commit

Permalink
Fix registration dashboard reports for unused regtypes
Browse files Browse the repository at this point in the history
If there was a reg type that was completely unused, it would always
show up with one unconfirmed registration. Oops.
  • Loading branch information
mhagander committed Feb 10, 2015
1 parent e03c969 commit 8bf49b4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion postgresqleu/confreg/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1428,7 +1428,7 @@ def admin_registration_dashboard(request, urlname):
tables = []

# Copy/paste string to get the reg status
statusstr = "sum(CASE WHEN payconfirmedat IS NOT NULL THEN 1 ELSE 0 END) AS confirmed, sum(CASE WHEN payconfirmedat IS NULL THEN 1 ELSE 0 END) as unconfirmed, count(*) AS total"
statusstr = "sum(CASE WHEN payconfirmedat IS NOT NULL THEN 1 ELSE 0 END) AS confirmed, sum(CASE WHEN payconfirmedat IS NULL AND r.id IS NOT NULL THEN 1 ELSE 0 END) as unconfirmed, count(r.id) AS total"
# Registrations by reg type
curs.execute("SELECT regtype, {0} FROM confreg_conferenceregistration r RIGHT JOIN confreg_registrationtype rt ON rt.id=r.regtype_id WHERE rt.conference_id={1} GROUP BY rt.id ORDER BY rt.sortkey".format(statusstr, conference.id))
tables.append({'title': 'Registration types',
Expand Down

0 comments on commit 8bf49b4

Please sign in to comment.