Check for required invoice information in other steps

This commit is contained in:
Raphael Michel
2017-07-19 14:10:04 +02:00
parent 28e676ac9a
commit baabbfb1ea

View File

@@ -313,6 +313,14 @@ class QuestionsStep(QuestionsViewMixin, CartMixin, TemplateFlowStep):
messages.warning(request, _('Please enter a valid email address.')) messages.warning(request, _('Please enter a valid email address.'))
return False return False
if request.event.settings.invoice_address_required and (not self.invoice_address or not self.invoice_address.street):
messages.warning(request, _('Please enter your invoicing address.'))
return False
if request.event.settings.invoice_name_required and (not self.invoice_address or not self.invoice_address.name):
messages.warning(request, _('Please enter your name.'))
return False
for cp in self.positions: for cp in self.positions:
answ = { answ = {
aw.question_id: aw.answer for aw in cp.answers.all() aw.question_id: aw.answer for aw in cp.answers.all()