Skip to content

Commit

Permalink
Correctly set the cli Group in Quart
Browse files Browse the repository at this point in the history
This was mistakenly set to Flask's in the Flask Sansio Scaffold, hence
Quart needs to override it to its own.
  • Loading branch information
pgjones committed Oct 1, 2023
1 parent dec661c commit c6877f6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/quart/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/quart/blueprints.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit c6877f6

Please sign in to comment.