From 7ceafb015fe745c5569a70b091143eb7908df835 Mon Sep 17 00:00:00 2001 From: ArturBaybulatov Date: Thu, 18 Aug 2016 21:41:25 +0300 Subject: [PATCH] #ARC-26; Fixes --- users/forms.py | 1 + users/migrations/0010_auto_20160818_2131.py | 20 ++++++++++ users/models.py | 2 +- users/templates/contractor_profile.html | 40 ++++++++++--------- users/templates/user_financial_info_edit.html | 8 ++-- users/templates/user_profile_edit.html | 9 ++--- users/urls.py | 1 - users/views.py | 5 +++ wallets/migrations/0007_auto_20160818_2131.py | 25 ++++++++++++ wallets/models.py | 4 +- wallets/views.py | 18 ++------- 11 files changed, 87 insertions(+), 46 deletions(-) create mode 100644 users/migrations/0010_auto_20160818_2131.py create mode 100644 wallets/migrations/0007_auto_20160818_2131.py diff --git a/users/forms.py b/users/forms.py index 31e0c77..381b021 100644 --- a/users/forms.py +++ b/users/forms.py @@ -42,6 +42,7 @@ class UserProfileEditForm(forms.ModelForm): gender = forms.ChoiceField( choices=GENDERS, widget=forms.RadioSelect, + required=False, ) class Meta: diff --git a/users/migrations/0010_auto_20160818_2131.py b/users/migrations/0010_auto_20160818_2131.py new file mode 100644 index 0000000..8ad6b39 --- /dev/null +++ b/users/migrations/0010_auto_20160818_2131.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.7 on 2016-08-18 18:31 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('users', '0009_merge'), + ] + + operations = [ + migrations.AlterField( + model_name='user', + name='gender', + field=models.CharField(blank=True, choices=[('male', 'Мужской'), ('female', 'Женский')], max_length=30, null=True), + ), + ] diff --git a/users/models.py b/users/models.py index 8e2ec92..ef6f9f2 100644 --- a/users/models.py +++ b/users/models.py @@ -131,7 +131,7 @@ class User(AbstractBaseUser, PermissionsMixin): email = models.EmailField(max_length=255, unique=True, db_index=True) financial_info = models.OneToOneField(UserFinancialInfo, related_name='user', blank=True, null=True) first_name = models.CharField(max_length=255, blank=True) - gender = models.CharField(max_length=30, choices=GENDERS, blank=True) + gender = models.CharField(max_length=30, choices=GENDERS, blank=True, null=True) is_active = models.BooleanField(default=True) last_name = models.CharField(max_length=255, blank=True) last_time_visit = models.DateTimeField(default=timezone.now) diff --git a/users/templates/contractor_profile.html b/users/templates/contractor_profile.html index d4ae9da..1dfb6a7 100644 --- a/users/templates/contractor_profile.html +++ b/users/templates/contractor_profile.html @@ -13,9 +13,15 @@
- {% thumbnail contractor.avatar "235x224" crop="center" as im %} - profile-image - {% endthumbnail %} +{# {% thumbnail contractor.avatar "235x224" crop="center" as im %}#} +{# profile-image#} +{# {% endthumbnail %}#} + + {% if contractor.avatar %} + profile-image + {% else %} + profile-image + {% endif %}
{% endif %} - -
-