forked from orbit-oss/flask
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:
parent
141fde1d8e
commit
c2920e2bd9
2 changed files with 15 additions and 1 deletions
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue