From 68c0adc46ddc295cd4d0e0d8b7fee0f5248ddd63 Mon Sep 17 00:00:00 2001 From: Gabriel Detraz Date: Sun, 25 Jun 2017 04:12:21 +0200 Subject: [PATCH] =?UTF-8?q?Cr=C3=A9e=20un=20champ=20t=C3=A9l=C3=A9phone?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- users/migrations/0051_user_telephone.py | 20 ++++++++++++++++++++ users/models.py | 7 +++---- users/templates/users/profil.html | 17 ++++++++++------- 3 files changed, 33 insertions(+), 11 deletions(-) create mode 100644 users/migrations/0051_user_telephone.py diff --git a/users/migrations/0051_user_telephone.py b/users/migrations/0051_user_telephone.py new file mode 100644 index 00000000..32aedebc --- /dev/null +++ b/users/migrations/0051_user_telephone.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.7 on 2017-06-25 02:06 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('users', '0050_serviceuser_comment'), + ] + + operations = [ + migrations.AddField( + model_name='user', + name='telephone', + field=models.CharField(blank=True, max_length=15, null=True), + ), + ] diff --git a/users/models.py b/users/models.py index 247d533c..4fd4aa98 100644 --- a/users/models.py +++ b/users/models.py @@ -163,6 +163,7 @@ class User(AbstractBaseUser): pwd_ntlm = models.CharField(max_length=255) state = models.IntegerField(choices=STATES, default=STATE_ACTIVE) registered = models.DateTimeField(auto_now_add=True) + telephone = models.CharField(max_length=15, blank=True, null=True) uid_number = models.IntegerField(default=auto_uid, unique=True) rezo_rez_uid = models.IntegerField(unique=True, blank=True, null=True) @@ -683,6 +684,7 @@ class BaseInfoForm(ModelForm): 'school', 'comment', 'room', + 'telephone', ] class EditInfoForm(BaseInfoForm): @@ -696,6 +698,7 @@ class EditInfoForm(BaseInfoForm): 'comment', 'room', 'shell', + 'telephone', ] class InfoForm(EditInfoForm): @@ -822,7 +825,3 @@ class WhitelistForm(ModelForm): if date_end < timezone.now(): raise forms.ValidationError("Triple buse, la date de fin ne peut pas être avant maintenant... Re2o ne voyage pas dans le temps") return date_end - - -class ProfilForm(Form): - user = forms.CharField(label='Ok', max_length=100) diff --git a/users/templates/users/profil.html b/users/templates/users/profil.html index b4137e4e..5478b1c7 100644 --- a/users/templates/users/profil.html +++ b/users/templates/users/profil.html @@ -69,17 +69,24 @@ with this program; if not, write to the Free Software Foundation, Inc., E-mail {{ user.email }} + + Chambre + {{ user.room }} + Téléphone + {{ user.telephone }} + École {{ user.school }} Commentaire {{ user.comment }} - - Chambre - {{ user.room }} + + Date d'inscription {{ user.registered }} + Dernière connexion + {{ user.last_login }} Fin d'adhésion @@ -123,10 +130,6 @@ with this program; if not, write to the Free Software Foundation, Inc., {% else %} Aucun {% endif %} - - Dernière connexion - {{ user.last_login }} -

Machines :

Ajouter une machine