Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork3.2k
Description
Summary
I was trying to overridePage
'stemplate_choices
andDEFAULT_TEMPLATE
so I can limit the options according to a page's parent, but it appears that in at least 3 key places where those attributes should be used,get_cms_setting('TEMPLATES')
is used instead, and so the selectable templates displayed are never limited like I intended.
The places I've found where this happens are theget_template
andget_template_name
methods. Also incms_toolbars.py
for the# templates menu
sectionget_cms_setting('TEMPLATES')
is used rather thanself.page.template_choices
.
More details about what I was trying to pull of can be found, here:https://stackoverflow.com/questions/52335541/how-to-limit-django-cms-template-choices-based-on-page-parent
Expected behaviour
template_choices
andDEFAULT_TEMPLATE
should define which templates are available for a Page in the CMS.
Actual behaviour
get_cms_setting('TEMPLATES')
is always used instead.
Environment
- Python version: 2.7.x
- Django version: 1.11.x
- django CMS version: 3.4.6