From 2872eb094a3200fba8d2f74a00b13085d7c4c03b Mon Sep 17 00:00:00 2001 From: Miguel Araujo Perez Date: Mon, 18 Apr 2011 18:12:53 +0200 Subject: [PATCH] Too many CSRF lines removed, we need to pass csrf context so that {% crsf_token %} works Now that CsrfResponseMiddleware has been deprecated in favor of CsrfViewMiddleware, we need to pass the csrf_token information, so that the template can render it. --- uni_form/templatetags/uni_form_tags.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/uni_form/templatetags/uni_form_tags.py b/uni_form/templatetags/uni_form_tags.py index 88f748e..d4a1d50 100644 --- a/uni_form/templatetags/uni_form_tags.py +++ b/uni_form/templatetags/uni_form_tags.py @@ -153,6 +153,9 @@ def get_response_dict(self, attrs, context): 'inputs': inputs, } + if context.has_key('csrf_token'): + response_dict['csrf_token'] = context['csrf_token'] + return response_dict ##################################################################