Skip to content

Commit

Permalink
Improvements in the smart_extends tag
Browse files Browse the repository at this point in the history
  • Loading branch information
goinnn committed Oct 6, 2013
1 parent 1acb52e commit 853b867
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions smartextends/templatetags/smart_extends_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ def find_template(name, dirs=None, skip_template=None):
if loader is not None:
loaders.append(loader)
template_source_loaders = tuple(loaders)
template_candidate = None
tsl_index = -1
if skip_template and skip_template.loadname == name:
for i, template_source_loader in enumerate(template_source_loaders):
Expand All @@ -68,16 +67,10 @@ def find_template(name, dirs=None, skip_template=None):
for loader in template_source_loaders[tsl_index + 1:]:
try:
source, display_name = loader(name, dirs)
if tsl_index is not None:
if not template_candidate:
template_candidate = (source, make_origin(display_name, loader, name, dirs))
else:
return (source, make_origin(display_name, loader, name, dirs))
return (source, make_origin(display_name, loader, name, dirs))
except TemplateDoesNotExist:
pass
if not template_candidate:
raise TemplateDoesNotExist(name)
return template_candidate
raise TemplateDoesNotExist(name)


class SmartExtendsNode(ExtendsNode):
Expand Down

0 comments on commit 853b867

Please sign in to comment.