Ticket #2619: simple_tag_set_context_r3680.diff

File simple_tag_set_context_r3680.diff, 712 bytes (added by slowness.chen@…, 9 years ago)
  • __init__.py

     
    828828
    829829            def render(self, context):
    830830                resolved_vars = [resolve_variable(var, context) for var in self.vars_to_resolve]
    831                 return func(*resolved_vars)
     831                func_ret = func(*resolved_vars)
     832                if isinstance(func_ret, dict):
     833                    context.update(func_ret)
     834                    return ''
     835                return func_ret
    832836
    833837        compile_func = curry(generic_tag_compiler, params, defaults, func.__name__, SimpleNode)
    834838        compile_func.__doc__ = func.__doc__
Back to Top