Fix blueprint nested url_prefix

This ensures that the url_prefix is correctly applied, no matter if
set during the registration override or when constructing the
blueprint.
This commit is contained in:
pgjones 2021-05-18 13:06:21 +01:00
parent a541c2ac8b
commit 99afbb277d
2 changed files with 28 additions and 42 deletions

View file

@ -354,7 +354,9 @@ class Blueprint(Scaffold):
bp_options["url_prefix"] = (
state.url_prefix.rstrip("/") + "/" + bp_url_prefix.lstrip("/")
)
else:
elif bp_url_prefix is not None:
bp_options["url_prefix"] = bp_url_prefix
elif state.url_prefix is not None:
bp_options["url_prefix"] = state.url_prefix
bp_options["name_prefix"] = options.get("name_prefix", "") + self.name + "."