From c6877f66d23dfc71e56c6b1f9721acd9af4e8b1e Mon Sep 17 00:00:00 2001 From: pgjones Date: Sun, 1 Oct 2023 16:36:19 +0100 Subject: [PATCH] Correctly set the cli Group in Quart This was mistakenly set to Flask's in the Flask Sansio Scaffold, hence Quart needs to override it to its own. --- src/quart/app.py | 4 ++++ src/quart/blueprints.py | 1 + 2 files changed, 5 insertions(+) diff --git a/src/quart/app.py b/src/quart/app.py index 3dddd30..54c6710 100644 --- a/src/quart/app.py +++ b/src/quart/app.py @@ -38,6 +38,7 @@ from werkzeug.wrappers import Response as WerkzeugResponse from .asgi import ASGIHTTPConnection, ASGILifespan, ASGIWebsocketConnection +from .cli import AppGroup from .ctx import ( _AppCtxGlobals, AppContext, @@ -315,6 +316,9 @@ def __init__( self.template_context_processors[None] = [_default_template_ctx_processor] + self.cli = AppGroup() # type: ignore[assignment] + self.cli.name = self.name + if self.has_static_folder: assert ( bool(static_host) == host_matching diff --git a/src/quart/blueprints.py b/src/quart/blueprints.py index 0cb54df..80b22da 100644 --- a/src/quart/blueprints.py +++ b/src/quart/blueprints.py @@ -56,6 +56,7 @@ def __init__(self, *args: t.Any, **kwargs: t.Any) -> None: super().__init__(*args, **kwargs) self.cli = AppGroup() # type: ignore[assignment] + self.cli.name = self.name self.after_websocket_funcs: t.Dict[ AppOrBlueprintKey, t.List[AfterWebsocketCallable]