mirror of
https://github.com/pretix/pretix.git
synced 2026-05-08 15:44: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
@@ -1,5 +1,6 @@
|
||||
from django.core.files import File
|
||||
from i18nfield.utils import I18nJSONEncoder
|
||||
from phonenumber_field.phonenumber import PhoneNumber
|
||||
|
||||
from pretix.base.reldate import RelativeDateWrapper
|
||||
|
||||
@@ -10,6 +11,8 @@ class CustomJSONEncoder(I18nJSONEncoder):
|
||||
return obj.to_string()
|
||||
elif isinstance(obj, File):
|
||||
return obj.name
|
||||
if isinstance(obj, PhoneNumber):
|
||||
return str(obj)
|
||||
else:
|
||||
return super().default(obj)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user