add support for ocuntry code allowlist, add dach to it
parent
e13d05a3df
commit
11854ab1ce
@ -0,0 +1,17 @@
|
|||||||
|
from dynamic_preferences.registries import global_preferences_registry
|
||||||
|
from dynamic_preferences.types import MultipleChoicePreference
|
||||||
|
from dynamic_preferences.types import Section
|
||||||
|
import phonenumbers
|
||||||
|
|
||||||
|
registration = Section("registation")
|
||||||
|
|
||||||
|
|
||||||
|
@global_preferences_registry.register
|
||||||
|
class AllowedPhoneCountries(MultipleChoicePreference):
|
||||||
|
section = registration
|
||||||
|
name = "allowed_countries"
|
||||||
|
choices = [
|
||||||
|
(f"{phonenumbers.country_code_for_region(cc)}", cc)
|
||||||
|
for cc in phonenumbers.SUPPORTED_REGIONS
|
||||||
|
]
|
||||||
|
default = [49, 41, 43]
|
Loading…
Reference in New Issue