Skip to content

Commit 6bd89f2

Browse files
committed
Fix UnboundLocalError occurrences
1 parent 0a18558 commit 6bd89f2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

graphene_django/views.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ def dispatch(self, request, *args, **kwargs):
111111
result, status_code = self.get_response(request, data, show_graphiql)
112112

113113
if show_graphiql:
114+
query, variables, operation_name, id = self.get_graphql_params(request, data)
114115
return self.render_graphiql(
115116
request,
116117
graphiql_version=self.graphiql_version,
@@ -146,6 +147,7 @@ def get_response(self, request, data, show_graphiql=False):
146147
show_graphiql
147148
)
148149

150+
status_code = 200
149151
if execution_result:
150152
response = {}
151153

@@ -155,7 +157,6 @@ def get_response(self, request, data, show_graphiql=False):
155157
if execution_result.invalid:
156158
status_code = 400
157159
else:
158-
status_code = 200
159160
response['data'] = execution_result.data
160161

161162
if self.batch:

0 commit comments

Comments
 (0)