Permalink
Browse files

Fixed a subtle bug with the {% load %} tag: if a tag/filter was remov…

…ed 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 #242 (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
  • Loading branch information...
1 parent 72e32b3 commit ffc3edd79ee4abc7a22ea07f0660322f50306334 @jacobian jacobian committed Aug 2, 2005
Showing with 3 additions and 1 deletion.
  1. +3 −1 django/core/defaulttags.py
@@ -225,7 +225,9 @@ def __init__(self, taglib):
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):

0 comments on commit ffc3edd

Please sign in to comment.