fix(NotPermittedPage): Add redirect-to even if starting with /app

A page like "/appointment" would redirect to /login, but without the redirect-to parameter, which is undesired
This commit is contained in:
Corentin Forler 2023-09-25 15:28:15 +02:00
parent f2277b9254
commit 443ffa06d5
No known key found for this signature in database

View file

@ -15,7 +15,7 @@ class NotPermittedPage(TemplatePage):
def render(self):
action = f"/login?redirect-to={frappe.request.path}"
if frappe.request.path.startswith("/app"):
if frappe.request.path.startswith("/app/") or frappe.request.path == "/app":
action = "/login"
frappe.local.message_title = _("Not Permitted")
frappe.local.response["context"] = dict(