From 6bc1bf1f06ec484f576143e66f62743cea8eea18 Mon Sep 17 00:00:00 2001 From: Gabriel Detraz Date: Sun, 18 Jun 2017 19:24:53 +0200 Subject: [PATCH] Add some comments et comment field sur ServiceUser --- users/migrations/0050_serviceuser_comment.py | 20 +++++++++++++++++++ users/models.py | 3 ++- users/templates/users/aff_serviceusers.html | 2 ++ users/templates/users/index_schools.html | 1 + users/templates/users/index_serviceusers.html | 4 +++- 5 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 users/migrations/0050_serviceuser_comment.py diff --git a/users/migrations/0050_serviceuser_comment.py b/users/migrations/0050_serviceuser_comment.py new file mode 100644 index 00000000..37bfd5cf --- /dev/null +++ b/users/migrations/0050_serviceuser_comment.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.7 on 2017-06-18 16:50 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('users', '0049_auto_20170618_1424'), + ] + + operations = [ + migrations.AddField( + model_name='serviceuser', + name='comment', + field=models.CharField(blank=True, help_text='Commentaire', max_length=255), + ), + ] diff --git a/users/models.py b/users/models.py index c69a8b0c..247d533c 100644 --- a/users/models.py +++ b/users/models.py @@ -385,6 +385,7 @@ class ServiceUser(AbstractBaseUser): pseudo = models.CharField(max_length=32, unique=True, help_text="Doit contenir uniquement des lettres, chiffres, ou tirets", validators=[linux_user_validator]) access_group = models.CharField(choices=ACCESS, default=readonly, max_length=32) + comment = models.CharField(help_text="Commentaire", max_length=255, blank=True) USERNAME_FIELD = 'pseudo' @@ -723,7 +724,7 @@ class ServiceUserForm(ModelForm): class EditServiceUserForm(ServiceUserForm): class Meta(ServiceUserForm.Meta): - fields = ['access_group'] + fields = ['access_group','comment'] class StateForm(ModelForm): class Meta: diff --git a/users/templates/users/aff_serviceusers.html b/users/templates/users/aff_serviceusers.html index 217892b0..01e223aa 100644 --- a/users/templates/users/aff_serviceusers.html +++ b/users/templates/users/aff_serviceusers.html @@ -27,6 +27,7 @@ with this program; if not, write to the Free Software Foundation, Inc., Nom Rôle + Commentaire @@ -34,6 +35,7 @@ with this program; if not, write to the Free Software Foundation, Inc., {{ serviceuser.pseudo }} {{ serviceuser.access_group }} + {{ serviceuser.comment }} {% include 'buttons/suppr.html' with href='users:del-serviceuser' id=serviceuser.id %} {% include 'buttons/edit.html' with href='users:edit-serviceuser' id=serviceuser.id %} diff --git a/users/templates/users/index_schools.html b/users/templates/users/index_schools.html index d0615f37..6e7b16c3 100644 --- a/users/templates/users/index_schools.html +++ b/users/templates/users/index_schools.html @@ -29,6 +29,7 @@ with this program; if not, write to the Free Software Foundation, Inc., {% block content %}

Liste des Établissements

+
Ensemble des établissements d'enseignement ou d'activité des utilisateurs crées
Ajouter un établissement Supprimer un ou plusieurs établissements {% include "users/aff_schools.html" with school_list=school_list %} diff --git a/users/templates/users/index_serviceusers.html b/users/templates/users/index_serviceusers.html index 8fdab8c2..61fd0a63 100644 --- a/users/templates/users/index_serviceusers.html +++ b/users/templates/users/index_serviceusers.html @@ -28,7 +28,9 @@ with this program; if not, write to the Free Software Foundation, Inc., {% block title %}Utilisateurs{% endblock %} {% block content %} -

Liste des service users

+

Liste des service users LDAP

+
Les service users LDAP sont des utilisateurs spéciaux qui disposent d'un accès uniquement sur le ldap pour effectuer des opération d'authentification. + Il est recommandé de créer un service-user doté d'un login/mdp par service concerné
Ajouter un service user {% include "users/aff_serviceusers.html" with serviceusers_list=serviceusers_list %}