From 3cb78055ff6ea9e74078a1164ec6ad337da91e60 Mon Sep 17 00:00:00 2001 From: Vivek Santayana Date: Fri, 19 Aug 2022 15:28:05 +0100 Subject: [PATCH] Added check for password reset from command line --- ref-test/app/models/user.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ref-test/app/models/user.py b/ref-test/app/models/user.py index 1c098ef..f9658b3 100644 --- a/ref-test/app/models/user.py +++ b/ref-test/app/models/user.py @@ -228,7 +228,7 @@ class User(UserMixin, db.Model): db.session.rollback() write('system.log', f'Database error when updating user {self.get_username()}: {exception}') return False, f'Database error: {exception}' - _current_user = current_user.get_username() if current_user.is_authenticated else 'anonymous' + _current_user = 'command line' if not current_user else 'anonymous' if not current_user.is_authenticated else current_user.get_username() write('system.log', f'Information for user {self.get_username()} has been updated by {_current_user}.') if notify: message = Message(