fix: redirect to /app if no apps are installed

This commit is contained in:
Shariq Ansari 2024-08-30 16:23:24 +05:30
parent 2973739f2e
commit f2e8f05558
3 changed files with 6 additions and 5 deletions

View file

@ -184,7 +184,7 @@ class LoginManager:
frappe.local.cookie_manager.set_cookie("system_user", "yes")
if not resume:
frappe.local.response["message"] = "Logged In"
frappe.local.response["home_page"] = get_default_path()
frappe.local.response["home_page"] = get_default_path() or "/app"
if not resume:
frappe.response["full_name"] = self.full_name

View file

@ -867,7 +867,7 @@ def update_password(
frappe.db.set_value("User", user, "reset_password_key", "")
if user_doc.user_type == "System User":
return get_default_path()
return get_default_path() or "/app"
else:
return redirect_url or get_default_path() or get_home_page()

View file

@ -27,9 +27,10 @@ def get_context(context):
if frappe.session.user != "Guest":
if not redirect_to:
redirect_to = get_default_path()
if frappe.session.data.user_type == "Website User" and not redirect_to:
redirect_to = get_home_page()
if frappe.session.data.user_type == "Website User":
redirect_to = get_default_path() or get_home_page()
else:
redirect_to = get_default_path() or "/app"
if redirect_to != "login":
frappe.local.flags.redirect_location = redirect_to