From 095651be9eec58ddb0c2eb6158318b1c703c67c5 Mon Sep 17 00:00:00 2001 From: David Lord Date: Mon, 25 Jul 2022 07:35:17 -0700 Subject: [PATCH] fix has_app_context and has_request_context --- src/flask/ctx.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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: