From 31d48a56ff432175994ffabf1a15dfbc1ab49b3b Mon Sep 17 00:00:00 2001 From: Jean-Marie PLACE Date: Tue, 25 Jan 2022 08:44:20 +0100 Subject: [PATCH] fix_user ; always send from no-reply ; reset passwd_temp --- app/auth/models.py | 1 + app/views/users.py | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/auth/models.py b/app/auth/models.py index 8f187b7e9..32768df03 100644 --- a/app/auth/models.py +++ b/app/auth/models.py @@ -112,6 +112,7 @@ class User(UserMixin, db.Model): self.password_hash = generate_password_hash(password) else: self.password_hash = None + self.passwd_temp = False def check_password(self, password): """Check given password vs current one. diff --git a/app/views/users.py b/app/views/users.py index fe65348cf..591753448 100644 --- a/app/views/users.py +++ b/app/views/users.py @@ -154,7 +154,7 @@ def create_user_form(user_name=None, edit=0, all_roles=1): if user_name is not None: # scodoc7func converti en int ! user_name = str(user_name) auth_dept = current_user.dept - from_mail = current_user.email + from_mail = current_app.config["SCODOC_MAIL_FROM"] # current_user.email initvalues = {} edit = int(edit) all_roles = int(all_roles) @@ -577,8 +577,8 @@ def create_user_form(user_name=None, edit=0, all_roles=1): # A: envoi de welcome + procedure de reset # B: envoi de welcome seulement (mot de passe saisie dans le formulaire) # C: Aucun envoi (mot de passe saisi dans le formulaire) - if vals["welcome"] == "1": - if vals["reset_password:list"] == "1": + if vals["welcome"] != "1": + if vals["reset_password"] != "1": mode = Mode.WELCOME_AND_CHANGE_PASSWORD else: mode = Mode.WELCOME_ONLY