Small user profile fix

This commit is contained in:
Skia 2016-08-11 04:57:07 +02:00
parent 43b709bfd5
commit 5113d8fda5
3 changed files with 50 additions and 5 deletions

View File

@ -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),
),
]

View File

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

View File

@ -14,9 +14,15 @@
<p><em>{{ profile.quote }}</em></p>
</div>
<h4>{{ profile.get_full_name() }}</h4>
{% if profile.nick_name %}
<p id="nickname">&laquo; {{ profile.nick_name }} &raquo;</p>
{% endif %}
{% if profile.date_of_birth %}
<p>{% trans %}Born: {% endtrans %}{{ profile.date_of_birth|date("d/m/Y") }}</p>
{% endif %}
{% if profile.department != "NA" %}
<p>{{ profile.department }}{{ profile.semester }}
{% endif %}
{% if profile.dpt_option %}
<br>{% trans %}Option: {% endtrans %}{{ profile.dpt_option }}
{% endif %}