mirror of
https://github.com/pretix/pretix.git
synced 2026-05-06 15:24:02 +00:00
Add question type: phone number (#1462)
* Add Phonenumber-Field as to Questions * Add setup requirements * Add list of ask-during-checkin restricted question types and enforce it * Fix requirements * Fix crash using custom locales * Re-format phone numbers when outputting to humans * Initialize country code field with a guess for the customer's country * Document TEL type in API docs
This commit is contained in:
committed by
Raphael Michel
parent
06a744ea2d
commit
54091b9721
@@ -77,6 +77,14 @@ class QuestionForm(I18nModelForm):
|
||||
dep = dep.dependency_question
|
||||
return val
|
||||
|
||||
def clean_ask_during_checkin(self):
|
||||
val = self.cleaned_data.get('ask_during_checkin')
|
||||
|
||||
if val and self.cleaned_data.get('type') in Question.ASK_DURING_CHECKIN_UNSUPPORTED:
|
||||
raise ValidationError(_('This type of question cannot be asked during check-in.'))
|
||||
|
||||
return val
|
||||
|
||||
def clean(self):
|
||||
d = super().clean()
|
||||
if d.get('dependency_question') and not d.get('dependency_values'):
|
||||
|
||||
Reference in New Issue
Block a user