From 44978896104a8457bb6276b323ef5b43695576da Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Mon, 20 Mar 2023 11:48:37 +0100 Subject: [PATCH] Fix typo in user_name check --- app/auth/models.py | 2 +- app/views/users.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/auth/models.py b/app/auth/models.py index 8743850d4e..37bbf9868c 100644 --- a/app/auth/models.py +++ b/app/auth/models.py @@ -296,7 +296,7 @@ class User(UserMixin, db.Model): self.user_name = data["user_name"] if "password" in data: 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}") # Roles: roles_string is "Ens_RT, Secr_RT, ..." if "roles_string" in data: diff --git a/app/views/users.py b/app/views/users.py index e6400882ae..31c6bf45df 100644 --- a/app/views/users.py +++ b/app/views/users.py @@ -337,8 +337,9 @@ def create_user_form(user_name=None, edit=0, all_roles=True): "title": "Pseudo (login)", "size": 20, "allow_null": False, - "explanation": "nom utilisé pour la connexion. Doit être unique parmi tous les utilisateurs." - "Lettres ou chiffres uniquement.", + "explanation": """nom utilisé pour la connexion. + Doit être unique parmi tous les utilisateurs. + Lettres ou chiffres uniquement.""", }, ), ("formsemestre_id", {"input_type": "hidden"}),