From a8b8612324a5ed2e81e1c68ce4c536d3a25300e4 Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Tue, 7 Oct 2025 14:58:57 +0200 Subject: [PATCH] Disallow searches for empty string This was already blocked in the frontend, but this is something that should be checked in the backend too. --- postgresqleu/confreg/checkin.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/postgresqleu/confreg/checkin.py b/postgresqleu/confreg/checkin.py index 84dde1e4..fa70f680 100644 --- a/postgresqleu/confreg/checkin.py +++ b/postgresqleu/confreg/checkin.py @@ -314,6 +314,8 @@ def api(request, urlname, regtoken, what): return _json_response({'reg': _get_reg_json(r)}) elif what == 'search': s = request.GET.get('search').strip() + if not s: + raise Http404() q = Q() for n in s.split(): # For each part of the given string, search both first and last name -- 2.39.5