From 53a008781f8b6bc0d4bd19ca4c087c6d76c56717 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Fri, 2 Sep 2022 08:25:04 +0200 Subject: [PATCH] Fix: typo creation users --- 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 43d347d7..7b8d9881 100644 --- a/app/views/users.py +++ b/app/views/users.py @@ -531,12 +531,12 @@ def create_user_form(user_name=None, edit=0, all_roles=True): user_name = vals["user_name"] # ce login existe ? err_msg = None - existing_user = User.query.filter_by(user_name=user_name).count() > 0 - if ( - edit and not existing_user + nb_existing_user = User.query.filter_by(user_name=user_name).count() > 0 + if edit and ( + nb_existing_user == 0 ): # safety net, le user_name ne devrait pas changer err_msg = f"identifiant {user_name} inexistant" - if not edit and not existing_user: + if not edit and nb_existing_user > 0: err_msg = f"identifiant {user_name} déjà utilisé" if err_msg: H.append(tf_error_message(f"""Erreur: {err_msg}""")) diff --git a/sco_version.py b/sco_version.py index bc55b7eb..60ae7efa 100644 --- a/sco_version.py +++ b/sco_version.py @@ -1,7 +1,7 @@ # -*- mode: python -*- # -*- coding: utf-8 -*- -SCOVERSION = "9.3.29" +SCOVERSION = "9.3.30" SCONAME = "ScoDoc"