diff --git a/users/__pycache__/models.cpython-34.pyc b/users/__pycache__/models.cpython-34.pyc index 3c8d3f85..68f71f73 100644 Binary files a/users/__pycache__/models.cpython-34.pyc and b/users/__pycache__/models.cpython-34.pyc differ diff --git a/users/__pycache__/urls.cpython-34.pyc b/users/__pycache__/urls.cpython-34.pyc index 6ebcd722..0722ae76 100644 Binary files a/users/__pycache__/urls.cpython-34.pyc and b/users/__pycache__/urls.cpython-34.pyc differ diff --git a/users/__pycache__/views.cpython-34.pyc b/users/__pycache__/views.cpython-34.pyc index 517008a2..ddf075bd 100644 Binary files a/users/__pycache__/views.cpython-34.pyc and b/users/__pycache__/views.cpython-34.pyc differ diff --git a/users/models.py b/users/models.py index c30e4a68..27c7963e 100644 --- a/users/models.py +++ b/users/models.py @@ -110,6 +110,7 @@ class StateForm(ModelForm): model = User fields = ['state'] + class SchoolForm(ModelForm): class Meta: model = School diff --git a/users/templates/users/aff_users.html b/users/templates/users/aff_users.html index 106fc3e8..ed17f82e 100644 --- a/users/templates/users/aff_users.html +++ b/users/templates/users/aff_users.html @@ -5,6 +5,7 @@ Nom Pseudo Inscrit le + Etat Profil @@ -14,6 +15,14 @@ {{ user.surname }} {{ user.pseudo }} {{ user.registered }} + {% if user.state == 0 %} + Actif + {% elif user.state == 1 %} + Désactivé + {% else %} + Archivé + {% endif %} +
{% csrf_token %} diff --git a/users/templates/users/profil.html b/users/templates/users/profil.html index 2ea0f583..e00b60c8 100644 --- a/users/templates/users/profil.html +++ b/users/templates/users/profil.html @@ -33,8 +33,37 @@ Chambre {{ user.room }} Date d'inscription - {{ user.registered}} + {{ user.registered }} + + Fin d'adhésion + {% if end_adhesion != None %} + {{ end_adhesion }} + {% else %} + Non adhérent + {% endif %} + Bannissement + {% if end_ban != None %} + {{ end_ban }} + {% else %} + Non banni + {% endif %} + + + Connexion + {% if actif == True %} + Active + {% else %} + Désactivée + {% endif %} + Statut + {% if user.state == 0 %} + Actif + {% elif user.state == 1 %} + Désactivé + {% else %} + Archivé + {% endif %}

Machines :

{% if machine_list %} diff --git a/users/views.py b/users/views.py index 8c1fa7b8..b66561ce 100644 --- a/users/views.py +++ b/users/views.py @@ -14,7 +14,7 @@ from cotisations.models import Facture from machines.models import Machine from users.forms import PassForm from search.models import SearchForm -from cotisations.views import is_adherent +from cotisations.views import is_adherent, end_adhesion from re2o.login import makeSecret, hashNT @@ -156,7 +156,10 @@ def profil(request): machines = None factures = Facture.objects.filter(user__pseudo = users) bans = Ban.objects.filter(user__pseudo = users) - return render(request, 'users/profil.html', {'user': users, 'machine_list' :machines, 'facture_list':factures, 'ban_list':bans}) + end = None + if(is_ban(users)): + end=end_ban(users) + return render(request, 'users/profil.html', {'user': users, 'machine_list' :machines, 'facture_list':factures, 'ban_list':bans, 'end_ban':end, 'end_adhesion':end_adhesion(users), 'actif':has_access(users)}) return redirect("/users/") return redirect("/users/")