Fix blueprint self registration
By raising a ValueError if attempted. I don't see a use case that makes this worth supporting.
This commit is contained in:
parent
9409be6e34
commit
714b0a467a
2 changed files with 8 additions and 0 deletions
|
|
@ -260,6 +260,8 @@ class Blueprint(Scaffold):
|
|||
|
||||
.. versionadded:: 2.0
|
||||
"""
|
||||
if blueprint is self:
|
||||
raise ValueError("Cannot register a blueprint on itself")
|
||||
self._blueprints.append((blueprint, options))
|
||||
|
||||
def register(self, app: "Flask", options: dict) -> None:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue