14
0
Files
python-sortinghat/support-new-django-graphql-jwt.patch
Steve Kowalik cd3001c571 - Update to 1.5.1:
* Update Poetry dependencies.
- Add patch support-new-django-graphql-jwt.patch:
  * Stop calling a now removed method in new django-graphql-jwt.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-sortinghat?expand=0&rev=48
2024-12-11 04:54:22 +00:00

25 lines
1.1 KiB
Diff

Index: grimoirelab-sortinghat-1.5.1/sortinghat/core/middleware.py
===================================================================
--- grimoirelab-sortinghat-1.5.1.orig/sortinghat/core/middleware.py
+++ grimoirelab-sortinghat-1.5.1/sortinghat/core/middleware.py
@@ -16,7 +16,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from django.http import Http404
-from graphql_jwt.compat import get_operation_name
from graphql_jwt.settings import jwt_settings
from . import tenant
@@ -27,7 +26,10 @@ def allow_any(info, **kwargs):
# "How to solve 'NoneType' object has no attribute 'fields' in
# Graphene-django" (https://stackoverflow.com/a/71296685).
try:
- operation_name = get_operation_name(info.operation.operation).title()
+ if hasattr(info.operation.operation, 'value'):
+ operation_name = info.operation.operation.value.title()
+ else:
+ operation_name = info.operation.operation.title()
operation_type = info.schema.get_type(operation_name)
if hasattr(operation_type, 'fields'):