1
0
mirror of https://github.com/django/django.git synced 2025-03-25 16:50:45 +00:00

Fixed a subtle bug with the {% load %} tag: if a tag/filter was removed from template.registered_tags/filters, {% load %} would fail (since module-level code is only run on an initial import). {% load %} now reloads the module, which makes sure that the tag always works even when someone's been doing something screwy. This fixes (and wouldn't had been found without it, so much thanks).

git-svn-id: http://code.djangoproject.com/svn/django/trunk@390 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Jacob Kaplan-Moss 2005-08-02 18:47:46 +00:00
parent 72e32b31f2
commit ffc3edd79e

@ -225,7 +225,9 @@ class LoadNode(template.Node):
self.taglib = taglib
def load_taglib(taglib):
return __import__("django.templatetags.%s" % taglib.split('.')[-1], '', '', [''])
mod = __import__("django.templatetags.%s" % taglib.split('.')[-1], '', '', [''])
reload(mod)
return mod
load_taglib = staticmethod(load_taglib)
def render(self, context):