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(