Skip to content
This repository has been archived by the owner on Oct 17, 2019. It is now read-only.

Commit

Permalink
fix for setting inheritance on a page
Browse files Browse the repository at this point in the history
  • Loading branch information
David Lee committed Feb 10, 2014
1 parent c20a6e8 commit 6e823ba
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion cms/models/pagemodel.py
Expand Up @@ -38,6 +38,7 @@ class Page(with_metaclass(PageMetaClass, MPTTModel)):
(1, _('for logged in users only')),
(2, _('for anonymous users only')),
)
TEMPLATE_DEFAULT = TEMPLATE_INHERITANCE_MAGIC if get_cms_setting('TEMPLATE_INHERITANCE') else get_cms_setting('TEMPLATES')[0][0]

template_choices = [(x, _(y)) for x, y in get_cms_setting('TEMPLATES')]

Expand All @@ -60,7 +61,7 @@ class Page(with_metaclass(PageMetaClass, MPTTModel)):
navigation_extenders = models.CharField(_("attached menu"), max_length=80, db_index=True, blank=True, null=True)
template = models.CharField(_("template"), max_length=100, choices=template_choices,
help_text=_('The template used to render the content.'),
default=TEMPLATE_INHERITANCE_MAGIC)
default=TEMPLATE_DEFAULT)
site = models.ForeignKey(Site, help_text=_('The site the page is accessible at.'), verbose_name=_("site"),
related_name='djangocms_pages')

Expand Down
3 changes: 2 additions & 1 deletion cms/utils/conf.py
Expand Up @@ -75,7 +75,8 @@ def get_media_url():

def get_templates():
templates = list(getattr(settings, 'CMS_TEMPLATES', []))
templates.append((constants.TEMPLATE_INHERITANCE_MAGIC, _('Inherit the template of the nearest ancestor')))
if get_cms_setting('TEMPLATE_INHERITANCE'):
templates.append((constants.TEMPLATE_INHERITANCE_MAGIC, _('Inherit the template of the nearest ancestor')))
return templates


Expand Down

0 comments on commit 6e823ba

Please sign in to comment.