Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cms.utils.conf.get_templates order is not predictable #6706

Open
sephii opened this issue Jul 29, 2019 · 0 comments

Comments

@sephii
Copy link
Contributor

commented Jul 29, 2019

Summary

When using CMS_TEMPLATES_DIR, the cms.utils.conf.get_templates function retrieves the list of templates using os.listdir, which, according to the documentation, doesn't guarantee any order. Should there be an __init__.py file in the CMS_TEMPLATES_DIR listing the available templates, the order is not predictable either on Python 3.5 since dict order is not preserved. This can cause issues, for example in some 3rd party libraries that rely on the templates order.

Expected behaviour

The list returned by get_templates is predictable.

Actual behaviour

The order of the items in the list is random.

Environment

  • Python version: 3.4
  • Django version: 1.11
  • django CMS version: 3.5.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.