diff --git a/erpnext/utilities/page/users/users.py b/erpnext/utilities/page/users/users.py index 5b76a2a4c7..347c9b2f26 100644 --- a/erpnext/utilities/page/users/users.py +++ b/erpnext/utilities/page/users/users.py @@ -81,6 +81,10 @@ def update_security(args=''): webnotes.conn.set_value('Profile', args['user'], 'login_after', args.get('login_after') or None) webnotes.conn.set_value('Profile', args['user'], 'login_before', args.get('login_before') or None) webnotes.conn.set_value('Profile', args['user'], 'enabled', int(args.get('enabled',0)) or 0) + + # logout a disabled user + if not int(args.get('enabled',0) or 0): + webnotes.login_manager.logout(user=args['user']) if args.get('new_password') and args.get('sys_admin_pwd'): from webnotes.utils import cint