1242: Убрать поле при регистрации

remotes/origin/top_year_choice
Alexander Burdeiny 10 years ago
parent 27a792ed95
commit b8bd704d49
  1. 16
      accounts/forms.py
  2. 4
      templates/client/popups/user_information.html

@ -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()

@ -49,6 +49,8 @@
</li>
<li>
<table>
{% comment %}
<tr>
<th>{% trans 'Номер телефона' %}</th>
<td class="width1">
@ -84,6 +86,8 @@
</td>
</tr>
{% endcomment %}
<tr>
<th>www.expomap.ru/</th>
<td class="input_bottom" colspan="3">

Loading…
Cancel
Save