This commit is contained in:
iFargle
2023-02-20 21:40:26 +09:00
parent 057ef8003b
commit 8e5b0d9488

View File

@@ -105,11 +105,8 @@ def has_no_empty_params(rule):
def site_map():
links = []
for rule in app.url_map.iter_rules():
# Filter out rules we can't navigate to in a browser
# and rules that require parameters
if "GET" in rule.methods and has_no_empty_params(rule):
url = url_for(rule.endpoint, **(rule.defaults or {}))
links.append((url, rule.endpoint))
url = url_for(rule.endpoint, **(rule.defaults or {}))
links.append((url, rule.endpoint))
# links is now a list of url, endpoint tuples
return Markup(links)