diff --git a/core/doctype/profile/profile.py b/core/doctype/profile/profile.py
index ed1718ae22..1bcdd2ff51 100644
--- a/core/doctype/profile/profile.py
+++ b/core/doctype/profile/profile.py
@@ -214,7 +214,7 @@ Thank you,
# disable the user and log him/her out
self.doc.enabled = 0
- if getattr(webnotes, "login_manager", None):
+ if webnotes.local.login_manager:
webnotes.local.login_manager.logout(user=self.doc.name)
# delete their password
diff --git a/webnotes/auth.py b/webnotes/auth.py
index cade976860..c4ade8e9cd 100644
--- a/webnotes/auth.py
+++ b/webnotes/auth.py
@@ -26,7 +26,7 @@ class HTTPRequest:
# override request method. All request to be of type POST, but if _type == "POST" then commit
if webnotes.form_dict.get("_type"):
- webnotes.request_method = webnotes.form_dict.get("_type")
+ webnotes.local.request_method = webnotes.form_dict.get("_type")
del webnotes.form_dict["_type"]
# set db
diff --git a/webnotes/handler.py b/webnotes/handler.py
index 6cf15eab7d..41f08cbc68 100755
--- a/webnotes/handler.py
+++ b/webnotes/handler.py
@@ -30,6 +30,7 @@ def web_logout():
webnotes.repsond_as_web_page("Logged Out", """
You have been logged out.
""") webnotes.local.login_manager.logout() + webnotes.conn.commit() @webnotes.whitelist() def uploadfile():