fix: Use hooks for handling /desk and /app routes

No need for random if statements, use the framework!
This commit is contained in:
Faris Ansari 2021-02-05 13:05:14 +05:30
parent e9be875b61
commit 46d2ede2e3
2 changed files with 5 additions and 7 deletions

View file

@ -58,6 +58,11 @@ website_route_rules = [
{"from_route": "/kb/<category>", "to_route": "Help Article"},
{"from_route": "/newsletters", "to_route": "Newsletter"},
{"from_route": "/profile", "to_route": "me"},
{"from_route": "/app/<path:app_path>", "to_route": "app"},
]
website_redirects = [
{"source": r"/desk(.*)", "target": r"/app\1"},
]
base_template = "templates/base.html"

View file

@ -252,13 +252,6 @@ def resolve_path(path):
if path != "index":
path = resolve_from_map(path)
if path.startswith("app"):
path = "app"
# to keep backward compatibility
if path.startswith("desk"):
path = "app"
return path
def resolve_from_map(path):