From 2676e1d7130160673c408987c4aeef83f9f57b6d Mon Sep 17 00:00:00 2001 From: Marian Sigler Date: Fri, 28 Sep 2012 03:12:52 +0200 Subject: Disable csrf where user is not logged in; Show CSRF errors in forms. --- templates/_macros.html | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'templates/_macros.html') diff --git a/templates/_macros.html b/templates/_macros.html index 265584f..1608c1f 100644 --- a/templates/_macros.html +++ b/templates/_macros.html @@ -8,6 +8,17 @@ {%- endmacro %} +{% macro render_csrf(form) %} +{{ form.csrf_token }} +{%- if 'csrf_token' in form.errors %} +
+
+ {{ render_errors(form.errors.csrf_token) }} +
+
+{%- endif %} +{%- endmacro %} + {% macro render_errors(errors) %} {%- if errors|length == 1 %}
-- cgit v1.2.3-1-g7c22