diff --git a/app/auth/models.py b/app/auth/models.py index 8743850d4..37bbf9868 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 e6400882a..31c6bf45d 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"}),