modified cms integrate to support separate content for each domain
This commit is contained in:
parent
9511428c9d
commit
d843c34d68
10 changed files with 105 additions and 24 deletions
14
datacenterlight/utils.py
Normal file
14
datacenterlight/utils.py
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue