From d6c6a0882843b184e2c528f5312d7b74f766f9be Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Wed, 5 Jan 2022 21:11:57 +0100 Subject: [PATCH 1/2] =?UTF-8?q?Fix:=202=20bugs=20sur=20formulaire=20cr?= =?UTF-8?q?=C3=A9ation/modif=20utilisateurs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users.py | 8 ++++---- sco_version.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/views/users.py b/app/views/users.py index be824173f..1d10e0f77 100644 --- a/app/views/users.py +++ b/app/views/users.py @@ -543,10 +543,10 @@ def create_user_form(user_name=None, edit=0, all_roles=1): vals["active"] = vals["status"] == "" # Département: if auth_dept: # pas super-admin - if vals["dept"] not in selectable_dept_acronyms: + if ("dept" in vals) and (vals["dept"] not in selectable_dept_acronyms): del vals["dept"] # ne change pas de dept - # traitement des roles: ne doit pas affecter les roles - # que l'on en controle pas: + # Traitement des roles: ne doit pas affecter les rôles + # que l'on en contrôle pas: for role in orig_roles_strings: # { "Ens_RT", "Secr_CJ", ... } if role and not role in editable_roles_strings: roles.add(role) @@ -575,7 +575,7 @@ def create_user_form(user_name=None, edit=0, all_roles=1): # A: envoi de welcome + procedure de reset # B: envoi de welcome seulement (mot de passe saisie dans le formulaire) # C: Aucun envoi (mot de passe saisi dans le formulaire) - if vals["welcome:list"] == "1": + if vals["welcome"] == "1": if vals["reset_password:list"] == "1": mode = Mode.WELCOME_AND_CHANGE_PASSWORD else: diff --git a/sco_version.py b/sco_version.py index 6a1559678..ed2b37284 100644 --- a/sco_version.py +++ b/sco_version.py @@ -1,7 +1,7 @@ # -*- mode: python -*- # -*- coding: utf-8 -*- -SCOVERSION = "9.1.17" +SCOVERSION = "9.1.18" SCONAME = "ScoDoc" From 20c8f22c7b55127367a61440fc82ce0cd689c330 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Wed, 5 Jan 2022 21:44:22 +0100 Subject: [PATCH 2/2] =?UTF-8?q?cosm=C3=A9tique=20accueil?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/scodoc/sco_preferences.py | 3 ++- app/static/css/scodoc.css | 11 +++++++++++ app/templates/scodoc.html | 8 +++++--- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/app/scodoc/sco_preferences.py b/app/scodoc/sco_preferences.py index cc99be082..da3e1a4ef 100644 --- a/app/scodoc/sco_preferences.py +++ b/app/scodoc/sco_preferences.py @@ -279,6 +279,7 @@ class BasePreferences(object): { "initvalue": "Dept", "title": "Nom abrégé du département", + "explanation": "acronyme: par exemple R&T, ORTF, HAL", "size": 12, "category": "general", "only_global": True, @@ -289,7 +290,7 @@ class BasePreferences(object): { "initvalue": "nom du département", "title": "Nom complet du département", - "explanation": "inutilisé par défaut", + "explanation": "apparaît sur la page d'accueil", "size": 40, "category": "general", "only_global": True, diff --git a/app/static/css/scodoc.css b/app/static/css/scodoc.css index 58f819c5b..72a918a69 100644 --- a/app/static/css/scodoc.css +++ b/app/static/css/scodoc.css @@ -239,6 +239,17 @@ div.box-chercheetud { margin-top: 12px; } +/* Page accueil général */ +span.dept_full_name { + font-style: italic; +} +span.dept_visible { + color: rgb(6, 158, 6); +} +span.dept_cache { + color: rgb(194, 5, 5); +} + div.table_etud_in_accessible_depts { margin-left: 3em; margin-bottom: 2em; diff --git a/app/templates/scodoc.html b/app/templates/scodoc.html index d5e453009..d48e7f5ad 100644 --- a/app/templates/scodoc.html +++ b/app/templates/scodoc.html @@ -17,11 +17,13 @@ Département {{dept.preferences.filter_by(name="DeptName").first().value}} - {{ dept.preferences.filter_by( name="DeptFullName" ).first().value or "" }} + + {{ dept.preferences.filter_by( name="DeptFullName" ).first().value or "" }} + {% if current_user.is_administrator() %} - - {% if dept.visible %}visible{% else %}caché aux utilisateurs{% endif %} + visible{% else %}class="dept_cache">caché aux utilisateurs{% endif %} + {% if dept.visible %}cacher{% else %}rendre visible{% endif %}