summaryrefslogtreecommitdiff
path: root/postgresqleu/confreg/views.py
diff options
context:
space:
mode:
authorMagnus Hagander2024-04-12 11:20:35 +0000
committerMagnus Hagander2024-04-15 17:31:57 +0000
commitc2661a39611eb2e22a105e80b40f76534be69bcc (patch)
treef8ef95a0161b3f8b174f45b68ff5ea270a156c31 /postgresqleu/confreg/views.py
parent35341693cdff8946ae9bd84f748b2782a7e0cc08 (diff)
Don't crash when trying to set dynamic fields on zero rows
This is similar to the fix in 55f1f7eb9 which fixed this problem for generating a report. But it did not consider that one might proceed to save the values even when the report was empty -- this path needs the same fix.
Diffstat (limited to 'postgresqleu/confreg/views.py')
-rw-r--r--postgresqleu/confreg/views.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/postgresqleu/confreg/views.py b/postgresqleu/confreg/views.py
index 27ee4315..27095ebf 100644
--- a/postgresqleu/confreg/views.py
+++ b/postgresqleu/confreg/views.py
@@ -3228,7 +3228,7 @@ def reports(request, confname):
if f not in conference.dynafields.split(','):
raise Http404("Unknown field specified")
- rids = list(map(int, request.POST['rids'].split(',')))
+ rids = list(map(int, request.POST['rids'].split(','))) if request.POST['rids'] else []
if request.POST['dynasetvalue'] != '':
exec_no_result("UPDATE confreg_conferenceregistration SET dynaprops = dynaprops || jsonb_build_object(%(fieldname)s, %(fieldval)s) WHERE conference_id=%(confid)s AND id=ANY(%(rids)s)", {
'rids': rids,