forked from CGM_Public/pretix_original
Co-authored-by: Raphael Michel <michel@rami.io>
This commit is contained in:
@@ -550,7 +550,8 @@ class BaseQuestionsForm(forms.Form):
|
||||
|
||||
if not self.all_optional:
|
||||
for q in question_cache.values():
|
||||
if question_is_required(q) and not d.get('question_%d' % q.pk):
|
||||
answer = d.get('question_%d' % q.pk)
|
||||
if question_is_required(q) and not answer and answer != 0:
|
||||
raise ValidationError({'question_%d' % q.pk: [_('This field is required')]})
|
||||
|
||||
return d
|
||||
|
||||
@@ -570,7 +570,7 @@ class QuestionsStep(QuestionsViewMixin, CartMixin, TemplateFlowStep):
|
||||
)
|
||||
|
||||
for q in cp.item.questions_to_ask:
|
||||
if question_is_required(q) and not answ.get(q.id):
|
||||
if question_is_required(q) and q.id not in answ:
|
||||
if warn:
|
||||
messages.warning(request, _('Please fill in answers to all required questions.'))
|
||||
return False
|
||||
|
||||
Reference in New Issue
Block a user