diff --git a/.gitignore b/.gitignore index cb627fc4..3a849c70 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,5 @@ Thumbs.db npm-debug.log /proj/local.py +atlassian-ide-plugin.xml + diff --git a/accounts/edit_forms.py b/accounts/edit_forms.py index ee602621..1f00bb1e 100644 --- a/accounts/edit_forms.py +++ b/accounts/edit_forms.py @@ -61,20 +61,9 @@ class WorkForm(forms.ModelForm): position = forms.CharField(label=_(u'Укажите вашу должность'), required=False, widget=forms.TextInput()) - company = forms.CharField(label=_(u'Место работы'), widget=forms.HiddenInput(attrs={'class': 'select2'})) - def __init__(self, *args, **kwargs): - super(WorkForm, self).__init__(*args, **kwargs) - if self.instance.company: - self.fields['company'].widget = forms.HiddenInput(attrs={'class': 'select2', 'data-init-text': self.instance.company.name}) class Meta: model = User - fields = ('position', 'company') - - def clean_company(self): - try: - return Company.objects.get(id=self.cleaned_data['company']) - except Company.DoesNotExist: - return None + fields = ('position',) class AboutCompanyForm(forms.ModelForm): @@ -91,6 +80,21 @@ class PhoneForm(forms.ModelForm): model = Profile fields = ('phone',) + def clean_phone(self): + phone = self.cleaned_data['phone'] + if not phone: + return + + deduct = ('-','(',')','.',' ', '+') + for elem in deduct: + phone = phone.replace(elem, '') + if phone.isdigit(): + return phone + else: + raise forms.ValidationError(_(u'Введите правильный телефон')) + + + class EmailForm(forms.ModelForm): email = forms.EmailField(label=_(u'Ваш e-mail'), required=False) diff --git a/templates/client/blank.html b/templates/client/blank.html index 3e786ee1..b5389f95 100644 --- a/templates/client/blank.html +++ b/templates/client/blank.html @@ -60,7 +60,7 @@ This template include basic anf main styles and js files, -->
{% block header %} - {% include 'header.html' %} + {% include 'includes/header.html' %} {% endblock %} {% block main_part %} {% endblock %} diff --git a/templates/client/includes/header.html b/templates/client/includes/header.html index 837234ee..ce23d413 100644 --- a/templates/client/includes/header.html +++ b/templates/client/includes/header.html @@ -51,7 +51,7 @@ {% if user.is_authenticated %}