From 16cf3e2414c09e6e3750a40485752e2f160221d2 Mon Sep 17 00:00:00 2001 From: Victoria Earl Date: Fri, 17 Jan 2025 16:03:04 -0500 Subject: [PATCH] Don't transfer to attendees with a blank transfer code --- uber/site_sections/preregistration.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/uber/site_sections/preregistration.py b/uber/site_sections/preregistration.py index ca5b1a212..b71000333 100644 --- a/uber/site_sections/preregistration.py +++ b/uber/site_sections/preregistration.py @@ -1625,9 +1625,14 @@ def complete_badge_transfer(self, session, id, code, message='', **params): if cherrypy.request.method != 'POST': raise HTTPRedirect('transfer_badge?id={}&message={}', id, "Please submit the form to transfer your badge.") + code = code.strip() + old = session.attendee(id) if not old.is_transferable: raise HTTPRedirect('../landing/index?message={}', 'This badge is not transferable.') + + if not code: + raise HTTPRedirect('transfer_badge?id={}&message={}', id, 'Please enter a transfer code.') transfer_badges = session.query(Attendee).filter( Attendee.normalized_transfer_code == RegistrationCode.normalize_code(code))