add maintainance mode
This commit is contained in:
parent
3ab1eb29b3
commit
36cc16f6a8
2 changed files with 6 additions and 2 deletions
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -161,4 +161,4 @@ def handle_session_stopped():
|
|||
</html>""")
|
||||
response.status_code = 503
|
||||
response.content_type = 'text/html'
|
||||
return res
|
||||
return response
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue