add maintainance mode

This commit is contained in:
Pratik Vyas 2014-03-28 00:03:44 +05:30
parent 3ab1eb29b3
commit 36cc16f6a8
2 changed files with 6 additions and 2 deletions

View file

@ -35,6 +35,10 @@ def application(request):
rollback = True
init_site(request)
if frappe.local.conf.get('maintainance_mode'):
raise frappe.SessionStopped
make_form_dict(request)
frappe.local.http_request = frappe.auth.HTTPRequest()
@ -85,7 +89,7 @@ def application(request):
frappe.db.rollback()
# set cookies
if response:
if response and hasattr(frappe.local, 'cookie_manager'):
frappe.local.cookie_manager.flush_cookies(response=response)
frappe.destroy()

View file

@ -161,4 +161,4 @@ def handle_session_stopped():
</html>""")
response.status_code = 503
response.content_type = 'text/html'
return res
return response