Skip to content

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

Correct patch_contrib_sites call

michal64220f35f1c2
diff --git a/saleor/site/models.py b/saleor/site/models.py
index d275b9ed99..c66e926d91 100644
--- a/saleor/site/models.py
+++ b/saleor/site/models.py
@@ -1,10 +1,13 @@
from django.contrib.sites.models import Site
from django.db import models
-
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import pgettext_lazy
from . import AuthenticationBackends
+from .patch_sites import patch_contrib_sites
+
+
+patch_contrib_sites()
@python_2_unicode_compatible
diff --git a/saleor/site/patch_sites.py b/saleor/site/patch_sites.py
index 75d13cc81c..e736f70762 100644
--- a/saleor/site/patch_sites.py
+++ b/saleor/site/patch_sites.py
@@ -22,6 +22,7 @@ with lock:
def new_get_current(self, request=None):
+ print "new get current"
from django.conf import settings
if getattr(settings, 'SITE_ID', ''):
site_id = settings.SITE_ID
@@ -72,6 +73,3 @@ def patch_contrib_sites():
SiteManager.get_current = new_get_current
SiteManager.clear_cache = new_clear_cache
SiteManager.get_by_natural_key = new_get_by_natural_key
-
-
-patch_contrib_sites()