Skip to content
Snippets Groups Projects
Commit eb015334 authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

Merge branch 'phone-number-country' into 'master'

Add phone number country setting from AlekSIS-App-CSVImport

See merge request !872
parents e7a13594 350a274b
No related branches found
No related tags found
1 merge request!872Add phone number country setting from AlekSIS-App-CSVImport
Pipeline #49239 canceled
...@@ -9,6 +9,11 @@ and this project adheres to `Semantic Versioning`_. ...@@ -9,6 +9,11 @@ and this project adheres to `Semantic Versioning`_.
Unreleased Unreleased
---------- ----------
Added
~~~~~
* Add preference for configuring the default phone number country code.
Fixed Fixed
~~~~~ ~~~~~
......
...@@ -3,6 +3,7 @@ from django.forms import EmailField, ImageField, URLField ...@@ -3,6 +3,7 @@ from django.forms import EmailField, ImageField, URLField
from django.forms.widgets import SelectMultiple from django.forms.widgets import SelectMultiple
from django.utils.translation import gettext_lazy as _ from django.utils.translation import gettext_lazy as _
import pycountry
from colorfield.widgets import ColorWidget from colorfield.widgets import ColorWidget
from dynamic_preferences.preferences import Section from dynamic_preferences.preferences import Section
from dynamic_preferences.types import ( from dynamic_preferences.types import (
...@@ -431,3 +432,13 @@ class AutoUpdatingDashboardSite(BooleanPreference): ...@@ -431,3 +432,13 @@ class AutoUpdatingDashboardSite(BooleanPreference):
name = "automatically_update_dashboard_site" name = "automatically_update_dashboard_site"
default = True default = True
verbose_name = _("Automatically update the dashboard and its widgets sitewide") verbose_name = _("Automatically update the dashboard and its widgets sitewide")
@site_preferences_registry.register
class PhoneNumberCountry(ChoicePreference):
section = internationalisation
name = "phone_number_country"
required = True
default = "GB"
choices = [(x.alpha_2, x.alpha_2) for x in pycountry.countries]
verbose_name = _("Country for phone number parsing")
...@@ -117,6 +117,7 @@ haystack-redis = "^0.0.1" ...@@ -117,6 +117,7 @@ haystack-redis = "^0.0.1"
python-gnupg = "^0.4.7" python-gnupg = "^0.4.7"
sentry-sdk = {version = "^1.4.3", optional = true} sentry-sdk = {version = "^1.4.3", optional = true}
django-cte = "^1.1.5" django-cte = "^1.1.5"
pycountry = "^20.7.3"
[tool.poetry.extras] [tool.poetry.extras]
ldap = ["django-auth-ldap"] ldap = ["django-auth-ldap"]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment