Bugfix allow blueprints to be registered with a different name

This allows the same blueprint to be registered multiple times at the
same level, but with differing url_prefixes and names.
This commit is contained in:
pgjones 2021-05-18 13:37:11 +01:00
parent 141fde1d8e
commit c2920e2bd9
2 changed files with 15 additions and 1 deletions

View file

@ -274,7 +274,8 @@ class Blueprint(Scaffold):
first_registration = False
name_prefix = options.get("name_prefix", "")
name = f"{name_prefix}.{self.name}".lstrip(".")
self_name = options.get("name", self.name)
name = f"{name_prefix}.{self_name}".lstrip(".")
if name in app.blueprints and app.blueprints[name] is not self:
raise ValueError(