Skip to content

Commit

Permalink
Revert "only load context processors once per request"
Browse files Browse the repository at this point in the history
This reverts commit 88c8059. This breaks
tests, so it needs some more work.
  • Loading branch information
Jeff Balogh committed Apr 15, 2011
1 parent 566d1ec commit 85a0939
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions jingo/__init__.py
Expand Up @@ -82,14 +82,10 @@ def render_to_string(request, template, context=None):
Render a template into a string.
"""
def get_context():
# Only call the context processors once per request.
if not hasattr(request, '_jingo_context'):
request._jingo_context = {}
for processor in get_standard_processors():
request._jingo_context.update(processor(request))
ctx = {} if context is None else context.copy()
ctx.update(request._jingo_context)
return ctx
c = {} if context is None else context.copy()
for processor in get_standard_processors():
c.update(processor(request))
return c

# If it's not a Template, it must be a path to be loaded.
if not isinstance(template, jinja2.environment.Template):
Expand Down

0 comments on commit 85a0939

Please sign in to comment.