From f8f8b0f2f04a29a3e2440c445586dd9941f5a8c8 Mon Sep 17 00:00:00 2001 From: Ben Davis Date: Tue, 12 Feb 2013 17:29:26 -0600 Subject: [PATCH] Fixed issue where {% form_field %} potentially clobbers template context --- formhelper/templatetags/formhelper.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/formhelper/templatetags/formhelper.py b/formhelper/templatetags/formhelper.py index 16a3ffb..5488ef7 100644 --- a/formhelper/templatetags/formhelper.py +++ b/formhelper/templatetags/formhelper.py @@ -46,7 +46,9 @@ def render(self, context): tpl = get_template('formhelper/includes/field.html') field = _get_field(self.field, form, context) context.update({'form': form, 'field': field}) - return tpl.render(context) + html = tpl.render(context) + context.pop() + return html @register.tag def form_field(parser, token):