forked from ScoDoc/ScoDoc
Fix: creation utilisateur.
This commit is contained in:
parent
0a62ee4dad
commit
8c5da97350
@ -530,16 +530,16 @@ def create_user_form(user_name=None, edit=0, all_roles=True):
|
|||||||
else:
|
else:
|
||||||
user_name = vals["user_name"]
|
user_name = vals["user_name"]
|
||||||
# ce login existe ?
|
# ce login existe ?
|
||||||
err = None
|
err_msg = None
|
||||||
existing_user = User.query.filter_by(user_name=user_name)
|
existing_user = User.query.filter_by(user_name=user_name).count() > 0
|
||||||
if (
|
if (
|
||||||
edit and existing_user is None
|
edit and not existing_user
|
||||||
): # safety net, le user_name ne devrait pas changer
|
): # safety net, le user_name ne devrait pas changer
|
||||||
err = f"identifiant {user_name} inexistant"
|
err_msg = f"identifiant {user_name} inexistant"
|
||||||
if not edit and existing_user is not None:
|
if not edit and not existing_user:
|
||||||
err = f"identifiant %{user_name} déjà utilisé"
|
err_msg = f"identifiant {user_name} déjà utilisé"
|
||||||
if err:
|
if err_msg:
|
||||||
H.append(tf_error_message(f"""Erreur: {err}"""))
|
H.append(tf_error_message(f"""Erreur: {err_msg}"""))
|
||||||
return "\n".join(H) + "\n" + tf[1] + F
|
return "\n".join(H) + "\n" + tf[1] + F
|
||||||
|
|
||||||
if not edit_only_roles:
|
if not edit_only_roles:
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# -*- mode: python -*-
|
# -*- mode: python -*-
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
SCOVERSION = "9.3.28"
|
SCOVERSION = "9.3.29"
|
||||||
|
|
||||||
SCONAME = "ScoDoc"
|
SCONAME = "ScoDoc"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user