Skip to content

Commit 4fc3e00

Browse files
committed
GraphQL | fixing root view and async method call
1 parent 15d5bc3 commit 4fc3e00

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

core/common/views.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1223,7 +1223,8 @@ def get(self, _):
12231223
name = 'current_user'
12241224
if name == 'core.toggles':
12251225
name = 'toggles'
1226-
1226+
if not name:
1227+
continue
12271228
host_url = main_host_url.replace('://api.', '://fhir.') if 'fhir' in name else main_host_url
12281229
data['routes'][name] = host_url + '/' + route
12291230

core/graphql/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
# https://strawberry.rocks/docs/breaking-changes/0.243.0 GraphQL Strawberry needs manually handling CSRF
2424
@method_decorator(csrf_exempt, name='dispatch')
2525
class AuthenticatedGraphQLView(AsyncGraphQLView):
26-
async def dispatch(self, request, *args, **kwargs):
26+
def dispatch(self, request, *args, **kwargs): # pylint: disable=invalid-overridden-method
2727
"""Enforce CSRF unless request supplies an auth token."""
2828
auth_header = get_authorization_header(request).split()
2929
if not (auth_header and auth_header[0].lower() in (b'token', b'bearer') and len(auth_header) >= 2):

0 commit comments

Comments
 (0)