refactor: reduce branching in init_request (#32981)
This commit is contained in:
parent
e355a175d8
commit
f62bae6f5a
1 changed files with 2 additions and 3 deletions
|
|
@ -177,14 +177,13 @@ def init_request(request):
|
|||
# site does not exist
|
||||
raise NotFound
|
||||
|
||||
frappe.connect(set_admin_as_user=False)
|
||||
if frappe.local.conf.maintenance_mode:
|
||||
frappe.connect()
|
||||
if frappe.local.conf.allow_reads_during_maintenance:
|
||||
setup_read_only_mode()
|
||||
else:
|
||||
raise frappe.SessionStopped("Session Stopped")
|
||||
else:
|
||||
frappe.connect(set_admin_as_user=False)
|
||||
|
||||
if request.path.startswith("/api/method/upload_file"):
|
||||
from frappe.core.api.file import get_max_file_size
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue