Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Fix codeclimate issues

Marcin Gębalad8fb2af7016f
diff --git a/saleor/graphql/file_upload/views.py b/saleor/graphql/file_upload/views.py
index 15c8f44c86..ee8fc339eb 100644
--- a/saleor/graphql/file_upload/views.py
+++ b/saleor/graphql/file_upload/views.py
@@ -1,24 +1,26 @@
-from django.conf import settings
-from graphene_django.views import GraphQLView
import json
+
import graphene
+from django.conf import settings
+from graphene_django.views import GraphQLView
# This class is modified verion of the `ModifiedGraphQLView` class from
# `graphene-file-upload` (https://github.com/lmcgartland/graphene-file-upload).
class FileUploadGraphQLView(GraphQLView):
-
def dispatch(self, request, *args, **kwargs):
# Handle options method the GraphQlView restricts it.
if request.method == 'OPTIONS':
- response = self.options(request, *args, **kwargs)
+ response = self.options(request, *args, **kwargs)
else:
response = super().dispatch(request, *args, **kwargs)
# Add access control headers
- response['Access-Control-Allow-Origin'] = ','.join(settings.ALLOWED_HOSTS)
+ response['Access-Control-Allow-Origin'] = ','.join(
+ settings.ALLOWED_HOSTS)
response['Access-Control-Allow-Methods'] = 'POST, OPTIONS'
- response['Access-Control-Allow-Headers'] = 'Origin, Content-Type, Accept, Authorization'
+ response[
+ 'Access-Control-Allow-Headers'] = 'Origin, Content-Type, Accept, Authorization'
return response
@staticmethod