Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Placeholder scanning is broken with cached template loader. #960

Merged
merged 1 commit into from

2 participants

@stephrdev

This fixes the placeholder scanning/template parsing when using the cached template loader.

Without this fix the test suite will freeze/infinite loop while parsing the templates.

To test this, we need to run the test suite two times, 1) without cached template loader 2) with cached template loader. I don't know if a testcase with settings override will work.

@stephrdev stephrdev This fixes the placeholder scanning/template parsing when using the c…
…ached template loader.

Without this fix the test suite will freeze/infinite loop while parsing the templates.
88f5784
@stephrdev

The problem first occured with this change: 62e419e

@ojii
Collaborator

looks sane, thanks

@ojii ojii merged commit a129321 into divio:develop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 19, 2011
  1. @stephrdev

    This fixes the placeholder scanning/template parsing when using the c…

    stephrdev authored
    …ached template loader.
    
    Without this fix the test suite will freeze/infinite loop while parsing the templates.
This page is out of date. Refresh to see the latest.
Showing with 14 additions and 4 deletions.
  1. +3 −1 cms/utils/plugins.py
  2. +11 −3 tests/project/settings.py
View
4 cms/utils/plugins.py
@@ -30,7 +30,9 @@ def _extend_blocks(extend_node, blocks):
else:
# set this node as the super node (for {{ block.super }})
block = blocks[node.name]
- while hasattr(block.super, 'nodelist'):
+ seen_supers = []
+ while hasattr(block.super, 'nodelist') and block.super not in seen_supers:
+ seen_supers.append(block.super)
block = block.super
block.super = node
# search for further ExtendsNodes
View
14 tests/project/settings.py
@@ -43,10 +43,18 @@
SECRET_KEY = '*xq7m@)*f2awoj!spa0(jibsrz9%c0d=e(g)v*!17y(vx0ue_3'
+#TEMPLATE_LOADERS = (
+# 'django.template.loaders.filesystem.Loader',
+# 'django.template.loaders.app_directories.Loader',
+# 'django.template.loaders.eggs.Loader',
+#)
+
TEMPLATE_LOADERS = (
- 'django.template.loaders.filesystem.Loader',
- 'django.template.loaders.app_directories.Loader',
- 'django.template.loaders.eggs.Loader',
+ ('django.template.loaders.cached.Loader', (
+ 'django.template.loaders.filesystem.Loader',
+ 'django.template.loaders.app_directories.Loader',
+ 'django.template.loaders.eggs.Loader',
+ )),
)
TEMPLATE_CONTEXT_PROCESSORS = [
Something went wrong with that request. Please try again.