1
0
forked from ScoDoc/ScoDoc

Fix: typo creation users

This commit is contained in:
Emmanuel Viennet 2022-09-02 08:25:04 +02:00
parent eab7894f4f
commit 53a008781f
2 changed files with 5 additions and 5 deletions

View File

@ -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}"""))

View File

@ -1,7 +1,7 @@
# -*- mode: python -*-
# -*- coding: utf-8 -*-
SCOVERSION = "9.3.29"
SCOVERSION = "9.3.30"
SCONAME = "ScoDoc"