Fix crash due to misnamed path argument in abs_url_for

This commit is contained in:
rubenwardy 2022-01-20 23:40:47 +00:00
parent e1a86f3be0
commit ef28fa026e

@ -33,9 +33,9 @@ def is_safe_url(target):
# These are given to Jinja in template_filters.py # These are given to Jinja in template_filters.py
def abs_url_for(path, **kwargs): def abs_url_for(endpoint: str, **kwargs):
scheme = "https" if app.config["BASE_URL"][:5] == "https" else "http" scheme = "https" if app.config["BASE_URL"][:5] == "https" else "http"
return url_for(path, _external=True, _scheme=scheme, **kwargs) return url_for(endpoint, _external=True, _scheme=scheme, **kwargs)
def abs_url(path): def abs_url(path):
return urljoin(app.config["BASE_URL"], path) return urljoin(app.config["BASE_URL"], path)