mirror of
https://github.com/apache/superset.git
synced 2026-04-21 09:04:38 +00:00
chore: use before_request hook for dynamic routes (#14568)
* chore: use before_request hook for dynamic routes * Shorten hook names * Introduce with_feature_flags and update thumbnail tests * Disable test that fails in CI but not locally * Add test for reports
This commit is contained in:
@@ -20,13 +20,14 @@ from typing import Any
|
||||
from flask import current_app, url_for
|
||||
|
||||
|
||||
def get_url_host(user_friendly: bool = False) -> str:
|
||||
if user_friendly:
|
||||
return current_app.config["WEBDRIVER_BASEURL_USER_FRIENDLY"]
|
||||
return current_app.config["WEBDRIVER_BASEURL"]
|
||||
|
||||
|
||||
def headless_url(path: str, user_friendly: bool = False) -> str:
|
||||
base_url = (
|
||||
current_app.config["WEBDRIVER_BASEURL_USER_FRIENDLY"]
|
||||
if user_friendly
|
||||
else current_app.config["WEBDRIVER_BASEURL"]
|
||||
)
|
||||
return urllib.parse.urljoin(base_url, path)
|
||||
return urllib.parse.urljoin(get_url_host(user_friendly=user_friendly), path)
|
||||
|
||||
|
||||
def get_url_path(view: str, user_friendly: bool = False, **kwargs: Any) -> str:
|
||||
|
||||
Reference in New Issue
Block a user