From 117160ea875dd6a601f9d9f792438ffc35d86c17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sascha=20I=C3=9Fbr=C3=BCcker?= Date: Fri, 20 May 2022 16:51:50 +0200 Subject: [PATCH] Enforce CSRF check for acknowledging toasts --- bookmarks/templates/bookmarks/layout.html | 5 +++- bookmarks/tests/test_toasts_view.py | 28 ++++++++++++++++++----- bookmarks/urls.py | 2 +- bookmarks/views/toasts.py | 3 ++- 4 files changed, 29 insertions(+), 9 deletions(-) diff --git a/bookmarks/templates/bookmarks/layout.html b/bookmarks/templates/bookmarks/layout.html index e6ce7a7b..9724b2b3 100644 --- a/bookmarks/templates/bookmarks/layout.html +++ b/bookmarks/templates/bookmarks/layout.html @@ -30,12 +30,15 @@
{% if has_toasts %}
+
+ {% csrf_token %} {% for toast in toast_messages %}
{{ toast.message }} - +
{% endfor %} +
{% endif %}