diff --git a/src/flask/ctx.py b/src/flask/ctx.py index 84d739ec..ca284494 100644 --- a/src/flask/ctx.py +++ b/src/flask/ctx.py @@ -213,7 +213,7 @@ def has_request_context() -> bool: .. versionadded:: 0.7 """ - return _cv_app.get(None) is not None + return _cv_request.get(None) is not None def has_app_context() -> bool: @@ -223,7 +223,7 @@ def has_app_context() -> bool: .. versionadded:: 0.9 """ - return _cv_request.get(None) is not None + return _cv_app.get(None) is not None class AppContext: