From df085e56ed44b63ca6f74a8f6d108ebb61783bca Mon Sep 17 00:00:00 2001 From: Javier Wong Date: Tue, 1 Mar 2016 16:06:10 +0800 Subject: [PATCH] [fixed] Multiple Sessions are Always Denied Casted frappe.db.get_system_setting('deny_multiple_sessions') to int, as a string it is always evaluated as True in the conditional statement and therefore it is always treated as multiple sessions are denied. --- frappe/auth.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/auth.py b/frappe/auth.py index 277f5a8df1..8c185ce78d 100644 --- a/frappe/auth.py +++ b/frappe/auth.py @@ -159,7 +159,7 @@ class LoginManager: def clear_active_sessions(self): """Clear other sessions of the current user if `deny_multiple_sessions` is not set""" - if not (frappe.conf.get("deny_multiple_sessions") or frappe.db.get_system_setting('deny_multiple_sessions')): + if not (frappe.conf.get("deny_multiple_sessions") or int(frappe.db.get_system_setting('deny_multiple_sessions'))): return if frappe.session.user != "Guest":