Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Cleanup
Patryk Zawadzkic576a75915db
diff --git a/saleor/core/context_processors.py b/saleor/core/context_processors.pyindex 126bc7bca7..ec2967d949 100644--- a/saleor/core/context_processors.py+++ b/saleor/core/context_processors.py@@ -11,9 +11,13 @@ def get_setting_as_dict(name, short_name=None):return {}+# request is a required parameter+# pylint: disable=W0613def default_currency(request):return get_setting_as_dict('DEFAULT_CURRENCY')+# request is a required parameter+# pylint: disable=W0613def categories(request):return {'categories': Category.tree.root_nodes().filter(hidden=False)}diff --git a/saleor/core/middleware.py b/saleor/core/middleware.pyindex 9bac8dfed9..7bf1643f9f 100644--- a/saleor/core/middleware.py+++ b/saleor/core/middleware.py@@ -1,7 +1,5 @@import logging-from subprocess import Popen, PIPE-from django.conf import settingsfrom django.utils.translation import get_languagefrom . import analytics@@ -10,21 +8,7 @@ from ..product.models import FixedProductDiscountlogger = logging.getLogger(__name__)-class CheckHTML(object):-- def process_response(self, request, response):- if (settings.DEBUG and- settings.WARN_ABOUT_INVALID_HTML5_OUTPUT and- 200 <= response.status_code < 300):- proc = Popen(['tidy'], stdout=PIPE, stderr=PIPE, stdin=PIPE)- dummy_out, err = proc.communicate(response.content)- for l in err.split('\n\n')[0].split('\n')[:-2]:- logger.warning(l)- return response--class GoogleAnalytics(object):-def process_request(self, request):client_id = analytics.get_client_id(request)path = request.path@@ -39,7 +23,6 @@ class GoogleAnalytics(object):class DiscountMiddleware(object):-def process_request(self, request):discounts = FixedProductDiscount.objects.all()discounts = discounts.prefetch_related('products')diff --git a/saleor/settings.py b/saleor/settings.pyindex 4e7ee85e3a..7fa39ffe70 100644--- a/saleor/settings.py+++ b/saleor/settings.py@@ -109,8 +109,7 @@ MIDDLEWARE_CLASSES = ['babeldjango.middleware.LocaleMiddleware','saleor.cart.middleware.CartMiddleware','saleor.core.middleware.DiscountMiddleware',- 'saleor.core.middleware.GoogleAnalytics',- 'saleor.core.middleware.CheckHTML'+ 'saleor.core.middleware.GoogleAnalytics']INSTALLED_APPS = [@@ -206,8 +205,6 @@ AUTH_USER_MODEL = 'userprofile.User'LOGIN_URL = '/account/login'-WARN_ABOUT_INVALID_HTML5_OUTPUT = False-DEFAULT_CURRENCY = 'USD'DEFAULT_WEIGHT = 'lb'