Skip to content
Snippets Groups Projects
Commit 5fbdf7cd authored by Tom Teichler's avatar Tom Teichler :beers:
Browse files

Validate voucher before creating user

parent 8d4d4e46
No related branches found
No related tags found
1 merge request!1Reformat and cleanup
Pipeline #56107 canceled
......@@ -415,6 +415,13 @@ class RegisterEventWizardView(SessionWizardView):
cleaned_data_financial = self.get_cleaned_data_for_step("financial")
cleaned_data_consent = self.get_cleaned_data_for_step("consent")
if cleaned_data_financial["voucher_code"] != "":
vouchers = Voucher.objects.filter(person=person, event=event, used=False, code=cleaned_data_financial["voucher_code"])
if vouchers:
voucher = vouchers.first()
else:
messages.error(self.request, _("You entered an invalid voucher code!"))
# Create email address
if cleaned_data_email:
_email = MailAddress.objects.create(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment