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

Prefill voucher code

parent 9b186c2d
No related branches found
No related tags found
No related merge requests found
Pipeline #106886 canceled
......@@ -519,6 +519,14 @@ class RegisterEventWizardView(SessionWizardView):
}
)
if step == "financial":
if getattr(self.request.user, "person", None):
vouchers = Voucher.objects.filter(
person=self.request.user.person, event__slug=self.kwargs["slug"], used=False
)
if vouchers:
initial.update({"voucher_code": vouchers.first().code})
return self.initial_dict.get(step, initial)
def done(self, form_list, **kwargs):
......
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