modified cms integrate to support separate content for each domain

This commit is contained in:
Arvind Tiwari 2018-04-03 22:41:29 +05:30
commit d843c34d68
10 changed files with 105 additions and 24 deletions

14
datacenterlight/utils.py Normal file
View file

@ -0,0 +1,14 @@
from django.contrib.sites.models import Site
from .cms_models import CMSIntegration
def get_cms_integration(name):
current_site = Site.objects.get_current()
try:
cms_integration = CMSIntegration.objects.get(
name=name, domain=current_site
)
except CMSIntegration.DoesNotExist:
cms_integration = CMSIntegration.objects.get(name=name, domain=None)
return cms_integration