Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions overextends/templatetags/overextends_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ def find_template(self, name, context, peeking=False):
except AttributeError:
# Django <= 1.7
app_template_dirs = app_directories.app_template_dirs

# Find the find_template_loader function (it moved in Django 1.8)
try:
# Django >= 1.8
find_template_loader = context.template.engine.find_template_loader
except AttributeError:
# Django <= 1.7
from django.template.loader import find_template_loader

# Store a dictionary in the template context mapping template
# names to the lists of template directories available to
# search for that template. Each time a template is loaded, its
Expand Down Expand Up @@ -101,8 +101,7 @@ def find_template(self, name, context, peeking=False):
# get_parent, and not when we're peeking during the
# second call.
if not peeking:
remove_path = os.path.abspath(path[:-len(name) - 1])
context[context_name][name].remove(remove_path)
del(context[context_name][name][0])
return Template(source)
raise TemplateDoesNotExist(name)

Expand Down