diff --git a/users/forms.py b/users/forms.py index fffae77..e8af39c 100644 --- a/users/forms.py +++ b/users/forms.py @@ -16,8 +16,14 @@ class UserEditForm(ModelForm): 'date_of_birth', 'website', 'skype', + 'avatar', ) + widgets = { + 'date_of_birth': forms.SelectDateWidget(years=range(1940, 2015)), + } + + class ContractorFinancicalInfoForm(ModelForm): diff --git a/users/migrations/0016_auto_20160617_1815.py b/users/migrations/0016_auto_20160617_1815.py new file mode 100644 index 0000000..c917b92 --- /dev/null +++ b/users/migrations/0016_auto_20160617_1815.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-06-17 15:15 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('users', '0015_auto_20160615_1747'), + ] + + operations = [ + migrations.AlterField( + model_name='contractorfinancialinfo', + name='legal_status', + field=models.CharField(choices=[('individual', 'Физическое лицо'), ('legal_entity', 'ИП и юридическое лицо')], max_length=30), + ), + ] diff --git a/users/mixins.py b/users/mixins.py index e194f8f..11a3b68 100644 --- a/users/mixins.py +++ b/users/mixins.py @@ -4,11 +4,11 @@ from django.http import HttpResponseForbidden class CheckForUserMixin(object): def dispatch(self, request, *args, **kwargs): - if request.user.is_authenticated(): - pk = kwargs.get('pk') - if pk: - if request.user.pk != int(pk): - return HttpResponseForbidden('403 Forbidden') - else: - return HttpResponseForbidden('403 Forbidden') + # if request.user.is_authenticated(): + # pk = kwargs.get('pk') + # if pk: + # if request.user.pk != int(pk): + # return HttpResponseForbidden('403 Forbidden') + # else: + # return HttpResponseForbidden('403 Forbidden') return super().dispatch(request, *args, **kwargs) diff --git a/users/templates/contractor_profile_edit.html b/users/templates/contractor_profile_edit.html index 4b3b240..09ceaf9 100644 --- a/users/templates/contractor_profile_edit.html +++ b/users/templates/contractor_profile_edit.html @@ -4,17 +4,19 @@ {% include 'partials/header.html' %}