Fix UnboundLocalError occurrences

This commit is contained in:
Michał Ochman 2016-10-31 12:16:58 +01:00
parent 0a18558bf6
commit 6bd89f2c78

View File

@ -111,6 +111,7 @@ class GraphQLView(View):
result, status_code = self.get_response(request, data, show_graphiql) result, status_code = self.get_response(request, data, show_graphiql)
if show_graphiql: if show_graphiql:
query, variables, operation_name, id = self.get_graphql_params(request, data)
return self.render_graphiql( return self.render_graphiql(
request, request,
graphiql_version=self.graphiql_version, graphiql_version=self.graphiql_version,
@ -146,6 +147,7 @@ class GraphQLView(View):
show_graphiql show_graphiql
) )
status_code = 200
if execution_result: if execution_result:
response = {} response = {}
@ -155,7 +157,6 @@ class GraphQLView(View):
if execution_result.invalid: if execution_result.invalid:
status_code = 400 status_code = 400
else: else:
status_code = 200
response['data'] = execution_result.data response['data'] = execution_result.data
if self.batch: if self.batch: