Bug
download_round_entries_csv raises an unhandled IndexError when the round has no entries, producing a raw internal server error page instead of a meaningful message.
Traceback
IndexError: list index out of range
montage/admin_endpoints.py, line 294
csv_fieldnames = sorted(entry_infos[0].keys())
When it happens
Any attempt to download the entries CSV for a round that has no entries — for example:
- Round 1 before images have been imported
- A round where all entries were disqualified
Root cause
download_round_entries_csv derives CSV field names from the first element of entry_infos. If the list is empty, entry_infos[0] crashes. There is no guard for this case.
Fix
Add an early return before line 114 in admin_endpoints.py:
if not entry_infos:
raise InvalidAction('no entries in round, cannot export CSV')
Confirmed on
montage-beta
Bug
download_round_entries_csvraises an unhandledIndexErrorwhen the round has no entries, producing a raw internal server error page instead of a meaningful message.Traceback
When it happens
Any attempt to download the entries CSV for a round that has no entries — for example:
Root cause
download_round_entries_csvderives CSV field names from the first element ofentry_infos. If the list is empty,entry_infos[0]crashes. There is no guard for this case.Fix
Add an early return before line 114 in
admin_endpoints.py:Confirmed on
montage-beta