File support-new-django-graphql-jwt.patch of Package python-sortinghat

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'):
openSUSE Build Service is sponsored by