From aac1d0c2ac7a59a55e5991e61612c6982f1ae1af Mon Sep 17 00:00:00 2001 From: Kuldeep Kapade Date: Fri, 20 Sep 2024 13:43:58 -0700 Subject: [PATCH] Patch for 3.0.x _app_ctx_stack.top is deprecated in the newer versions --- flask_githubapp/core.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flask_githubapp/core.py b/flask_githubapp/core.py index 661f8d0..a7994b5 100644 --- a/flask_githubapp/core.py +++ b/flask_githubapp/core.py @@ -2,7 +2,7 @@ import hmac import logging -from flask import abort, current_app, jsonify, make_response, request, _app_ctx_stack +from flask import abort, current_app, jsonify, make_response, request, g from github3 import GitHub, GitHubEnterprise from werkzeug.exceptions import BadRequest @@ -115,7 +115,7 @@ def payload(self): @property def installation_client(self): """GitHub client authenticated as GitHub app installation""" - ctx = _app_ctx_stack.top + ctx = g if ctx is not None: if not hasattr(ctx, 'githubapp_installation'): client = self.client @@ -128,7 +128,7 @@ def installation_client(self): @property def app_client(self): """GitHub client authenticated as GitHub app""" - ctx = _app_ctx_stack.top + ctx = g if ctx is not None: if not hasattr(ctx, 'githubapp_app'): client = self.client