8000 Fixed flake8 issues · graphql-python/sanic-graphql@2408c16 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2408c16

Browse files
committed
Fixed flake8 issues
1 parent 88f2b1d commit 2408c16

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

sanic_graphql/graphqlview.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
1-
import json
2-
import six
31
from functools import partial
42
from cgi import parse_header
53

64

75
from promise import Promise
86
from sanic.response import HTTPResponse
97
from sanic.views import HTTPMethodView
10-
from sanic.exceptions import SanicException
118

129
from graphql.type.schema import GraphQLSchema
1310
from graphql.execution.executors.asyncio import AsyncioExecutor
@@ -39,7 +36,6 @@ def __init__(self, **kwargs):
3936
if hasattr(self, key):
4037
setattr(self, key, value)
4138

42-
4339
self._enable_async = self._enable_async and isinstance(kwargs.get('executor'), AsyncioExecutor)
4440
assert isinstance(self.schema, GraphQLSchema), 'A Schema is required to be provided to GraphQLView.'
4541

@@ -135,8 +131,7 @@ def parse_body(self, request):
135131
elif content_type == 'application/json':
136132
return load_json_body(request.body.decode('utf8'))
137133

138-
elif content_type == 'application/x-www-form-urlencoded' \
139-
or content_type == 'multipart/form-data':
134+
elif content_type in ('application/x-www-form-urlencoded', 'multipart/form-data'):
140135
return request.form
141136

142137
return {}
@@ -147,7 +142,7 @@ def get_mime_type(request):
147142
# information provided by content_type
148143
if 'content-type' not in request.headers:
149144
return None
150-
145+
151146
mimetype, _ = parse_header(request.headers['content-type'])
152147
return mimetype
153148

0 commit comments

Comments
 (0)
0