1
0
forked from ScoDoc/ScoDoc

Fix typo in user_name check

This commit is contained in:
Emmanuel Viennet 2023-03-20 11:48:37 +01:00
parent f2de6ab80c
commit 4497889610
2 changed files with 4 additions and 3 deletions

View File

@ -296,7 +296,7 @@ class User(UserMixin, db.Model):
self.user_name = data["user_name"] self.user_name = data["user_name"]
if "password" in data: if "password" in data:
self.set_password(data["password"]) self.set_password(data["password"])
if not invalid_user_name(self.user_name): if invalid_user_name(self.user_name):
raise ValueError(f"invalid user_name: {self.user_name}") raise ValueError(f"invalid user_name: {self.user_name}")
# Roles: roles_string is "Ens_RT, Secr_RT, ..." # Roles: roles_string is "Ens_RT, Secr_RT, ..."
if "roles_string" in data: if "roles_string" in data:

View File

@ -337,8 +337,9 @@ def create_user_form(user_name=None, edit=0, all_roles=True):
"title": "Pseudo (login)", "title": "Pseudo (login)",
"size": 20, "size": 20,
"allow_null": False, "allow_null": False,
"explanation": "nom utilisé pour la connexion. Doit être unique parmi tous les utilisateurs." "explanation": """nom utilisé pour la connexion.
"Lettres ou chiffres uniquement.", Doit être unique parmi tous les utilisateurs.
Lettres ou chiffres uniquement.""",
}, },
), ),
("formsemestre_id", {"input_type": "hidden"}), ("formsemestre_id", {"input_type": "hidden"}),