Skip to content

Commit

Permalink
This fixes the placeholder scanning/template parsing when using the c…
Browse files Browse the repository at this point in the history
…ached template loader.

Without this fix the test suite will freeze/infinite loop while parsing the templates.
  • Loading branch information
stephrdev committed Aug 19, 2011
1 parent 03e7d01 commit 88f5784
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
4 changes: 3 additions & 1 deletion cms/utils/plugins.py
Expand Up @@ -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
Expand Down
14 changes: 11 additions & 3 deletions tests/project/settings.py
Expand Up @@ -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 = [
Expand Down

0 comments on commit 88f5784

Please sign in to comment.