diff --git a/core/migrations/0006_auto_20160811_0450.py b/core/migrations/0006_auto_20160811_0450.py new file mode 100644 index 00000000..f2970302 --- /dev/null +++ b/core/migrations/0006_auto_20160811_0450.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('core', '0005_auto_20160811_0319'), + ] + + operations = [ + migrations.AlterField( + model_name='user', + name='dpt_option', + field=models.CharField(verbose_name='dpt option', null=True, max_length=32, blank=True), + ), + migrations.AlterField( + model_name='user', + name='forum_signature', + field=models.TextField(verbose_name='forum signature', null=True, max_length=256, blank=True), + ), + migrations.AlterField( + model_name='user', + name='quote', + field=models.CharField(verbose_name='quote', null=True, max_length=64, blank=True), + ), + migrations.AlterField( + model_name='user', + name='school', + field=models.CharField(verbose_name='school', null=True, max_length=32, blank=True), + ), + migrations.AlterField( + model_name='user', + name='semester', + field=models.CharField(verbose_name='semester', null=True, max_length=5, blank=True), + ), + ] diff --git a/core/models.py b/core/models.py index 554ba3fd..15229a8a 100644 --- a/core/models.py +++ b/core/models.py @@ -148,12 +148,12 @@ class User(AbstractBaseUser): ("HUMAN", _("Humanities")), ("NA", _("N/A")), ], default="NA") - dpt_option = models.CharField(_("dpt option"), max_length=32, default="") - semester = models.CharField(_("semester"), max_length=5, default="") - quote = models.CharField(_("quote"), max_length=64, default="") - school = models.CharField(_("school"), max_length=32, default="") + dpt_option = models.CharField(_("dpt option"), max_length=32, null=True, blank=True) + semester = models.CharField(_("semester"), max_length=5, null=True, blank=True) + quote = models.CharField(_("quote"), max_length=64, null=True, blank=True) + school = models.CharField(_("school"), max_length=32, null=True, blank=True) promo = models.IntegerField(_("promo"), validators=[validate_promo], null=True, blank=True) - forum_signature = models.TextField(_("forum signature"), max_length=256, default="") + forum_signature = models.TextField(_("forum signature"), max_length=256, null=True, blank=True) # TODO: add phone numbers with https://github.com/stefanfoulis/django-phonenumber-field objects = UserManager() diff --git a/core/templates/core/user_detail.jinja b/core/templates/core/user_detail.jinja index 0e40bafc..86c90ee9 100644 --- a/core/templates/core/user_detail.jinja +++ b/core/templates/core/user_detail.jinja @@ -14,9 +14,15 @@
{{ profile.quote }}
« {{ profile.nick_name }} »
+ {% endif %} + {% if profile.date_of_birth %}{% trans %}Born: {% endtrans %}{{ profile.date_of_birth|date("d/m/Y") }}
+ {% endif %} + {% if profile.department != "NA" %}{{ profile.department }}{{ profile.semester }}
+ {% endif %}
{% if profile.dpt_option %}
{% trans %}Option: {% endtrans %}{{ profile.dpt_option }}
{% endif %}