Fix to logout previous session on login
diff --git a/erpnext/startup/event_handlers.py b/erpnext/startup/event_handlers.py
index 71ae767..59fa0fd 100644
--- a/erpnext/startup/event_handlers.py
+++ b/erpnext/startup/event_handlers.py
@@ -56,10 +56,8 @@
sid!=%s
ORDER BY lastupdate desc""", \
(webnotes.session['user'], webnotes.session['sid']), as_list=1)
- if sid_list and len(sid_list)>1:
- for i in xrange(len(sid_list)):
- if i>0:
- webnotes.conn.sql("DELETE FROM `tabSessions` WHERE sid=%s", sid_list[i][0])
+ for sid in sid_list:
+ webnotes.conn.sql("DELETE FROM `tabSessions` WHERE sid=%s", sid[0])
update_account_details()