From b8bd704d498e9940a31ce4ff7896ee9f90e839f4 Mon Sep 17 00:00:00 2001 From: Alexander Burdeiny Date: Thu, 14 Apr 2016 18:05:02 +0300 Subject: [PATCH] =?UTF-8?q?1242:=20=D0=A3=D0=B1=D1=80=D0=B0=D1=82=D1=8C=20?= =?UTF-8?q?=D0=BF=D0=BE=D0=BB=D0=B5=20=D0=BF=D1=80=D0=B8=20=D1=80=D0=B5?= =?UTF-8?q?=D0=B3=D0=B8=D1=81=D1=82=D1=80=D0=B0=D1=86=D0=B8=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- accounts/forms.py | 16 ++++++++-------- templates/client/popups/user_information.html | 4 ++++ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/accounts/forms.py b/accounts/forms.py index 3612168b..d47d65c3 100644 --- a/accounts/forms.py +++ b/accounts/forms.py @@ -206,12 +206,12 @@ class RegistrationCompleteForm(forms.ModelForm): city = forms.CharField(label='Город', widget=forms.HiddenInput()) url = forms.CharField(widget=forms.TextInput(attrs={'placeholder': _(u'url(обязательно)')})) - code_country = forms.ChoiceField(label=_(u'код страны'), initial='70', - choices=[(str(c.phone_code), '+' + str(c.phone_code)) for c in - Country.objects.all() if c.phone_code is not None], - widget=forms.Select(attrs={'class': 'select2'})) - code_city = forms.CharField(label=_(u'код города')) - phone = forms.CharField(label=_(u'ваш номер')) + # code_country = forms.ChoiceField(label=_(u'код страны'), initial='70', + # choices=[(str(c.phone_code), '+' + str(c.phone_code)) for c in + # Country.objects.all() if c.phone_code is not None], + # widget=forms.Select(attrs={'class': 'select2'})) + # code_city = forms.CharField(label=_(u'код города')) + # phone = forms.CharField(label=_(u'ваш номер')) class Meta: model = User @@ -220,9 +220,9 @@ class RegistrationCompleteForm(forms.ModelForm): def save(self, force_insert=False, force_update=False, commit=True): user = super(RegistrationCompleteForm, self).save(commit=False) data = self.cleaned_data - phone = data['code_country'] + data['code_city'] + data['phone'] + # phone = data['code_country'] + data['code_city'] + data['phone'] - user.profile.phone = int(phone) + # user.profile.phone = int(phone) user.profile.country = data['country'] user.profile.city = data['city'] user.profile.save() diff --git a/templates/client/popups/user_information.html b/templates/client/popups/user_information.html index d2b21c2c..e8ae24ff 100644 --- a/templates/client/popups/user_information.html +++ b/templates/client/popups/user_information.html @@ -49,6 +49,8 @@
  • + + {% comment %} + {% endcomment %} +
    {% trans 'Номер телефона' %} @@ -84,6 +86,8 @@
    www.expomap.ru/