Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Fix codeclimate issues
Marcin Gębalad8fb2af7016f
diff --git a/saleor/graphql/file_upload/views.py b/saleor/graphql/file_upload/views.pyindex 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 GraphQLViewimport 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