Fixed logout issues
diff --git a/erpnext/home/page/my_company/my_company.py b/erpnext/home/page/my_company/my_company.py
index 4931ea9..dfeb30f 100644
--- a/erpnext/home/page/my_company/my_company.py
+++ b/erpnext/home/page/my_company/my_company.py
@@ -34,11 +34,8 @@
return 'Cannot disable Administrator'
webnotes.conn.sql("update tabProfile set enabled=0 where name=%s", arg)
- sid_list = webnotes.conn.sql("SELECT sid FROM `tabSessions` WHERE user=%s", arg)
- from webnotes.auth import LoginManager
login_manager = LoginManager()
- for sid in sid_list:
- login_manager.logout(sid=sid)
+ login_manager.logout(user=arg)
return 0
#
diff --git a/erpnext/startup/event_handlers.py b/erpnext/startup/event_handlers.py
index ce5c4c4..7dd6c9a 100644
--- a/erpnext/startup/event_handlers.py
+++ b/erpnext/startup/event_handlers.py
@@ -50,10 +50,6 @@
if webnotes.session['user'] not in exception_list:
# Clear previous sessions i.e. logout previous log-in attempts
sid_list = webnotes.conn.sql("SELECT sid FROM `tabSessions` WHERE user=%s AND sid!=%s", (webnotes.session['user'], webnotes.session['sid']))
- from webnotes.auth import LoginManager
- login_manager = LoginManager()
- for sid in sid_list:
- login_manager.logout(sid=sid)
update_account_details()
@@ -63,7 +59,7 @@
def on_logout(login_manager):
if cint(webnotes.conn.get_value('Control Panel', None, 'sync_with_gateway')):
from server_tools.gateway_utils import logout_sso
- logout_sso(login_manager.sid)
+ logout_sso(user=login_manager.user)
#
# create a profile (if logs in for the first time)