Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Add PhonePrefixWidget template

dominik-zeglence57b8e8be22
diff --git a/saleor/userprofile/i18n.py b/saleor/userprofile/i18n.py
index 6f4fea5541..5d1c59d4fc 100644
--- a/saleor/userprofile/i18n.py
+++ b/saleor/userprofile/i18n.py
@@ -68,6 +68,8 @@ class PhonePrefixWidget(PhoneNumberPrefixWidget):
https://github.com/stefanfoulis/django-phonenumber-field/issues/82
"""
+ template_name = 'userprofile/snippets/phone-prefix-widget.html'
+
def __init__(self, attrs=None):
widgets = (Select(attrs=attrs, choices=phone_prefixes), TextInput())
super(PhoneNumberPrefixWidget, self).__init__(widgets, attrs)
diff --git a/templates/userprofile/snippets/phone-prefix-widget.html b/templates/userprofile/snippets/phone-prefix-widget.html
new file mode 100644
index 0000000000..90ed8199f1
--- /dev/null
+++ b/templates/userprofile/snippets/phone-prefix-widget.html
@@ -0,0 +1,5 @@
+<div>
+ {% for widget in widget.subwidgets %}
+ {% include widget.template_name %}
+ {% endfor %}
+</div>