Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Add unicode literals, clean up
Patryk Zawadzki68df4598ff8a
diff --git a/saleor/site/__init__.py b/saleor/site/__init__.pyindex 2739f52689..8983158430 100644--- a/saleor/site/__init__.py+++ b/saleor/site/__init__.py@@ -1,3 +1,6 @@+from __future__ import unicode_literals++class AuthenticationBackends:GOOGLE = 'google-oauth2'FACEBOOK = 'facebook'diff --git a/saleor/site/models.py b/saleor/site/models.pyindex c66e926d91..5b87d8fe5f 100644--- a/saleor/site/models.py+++ b/saleor/site/models.py@@ -1,3 +1,5 @@+from __future__ import unicode_literals+from django.contrib.sites.models import Sitefrom django.db import modelsfrom django.utils.encoding import python_2_unicode_compatible@@ -6,7 +8,6 @@ from django.utils.translation import pgettext_lazyfrom . import AuthenticationBackendsfrom .patch_sites import patch_contrib_sites-patch_contrib_sites()diff --git a/saleor/site/patch_sites.py b/saleor/site/patch_sites.pyindex 6ca74c1d46..cbc45c0a5f 100644--- a/saleor/site/patch_sites.py+++ b/saleor/site/patch_sites.py@@ -3,6 +3,7 @@ Since django.contrib.sites may not be thread-safe when there aremultiple instances of the application server, we're patching it witha thread-safe structure and methods that use it underneath.'''+from __future__ import unicode_literalsimport threading@@ -10,7 +11,6 @@ from django.contrib.sites.models import SiteManagerfrom django.core.exceptions import ImproperlyConfiguredfrom django.http.request import split_domain_port-lock = threading.Lock()with lock:THREADED_SITE_CACHE = {}diff --git a/saleor/site/utils.py b/saleor/site/utils.pyindex b437e77cd9..4f6d1f2fa7 100644--- a/saleor/site/utils.py+++ b/saleor/site/utils.py@@ -1,6 +1,8 @@+from __future__ import unicode_literals+from django.conf import settings-from .models import SiteSettings, AuthorizationKey+from .models import AuthorizationKeydef get_authorization_key_for_backend(backend_name):