From eac925f740f8e0347753b7fec7d8baee0c51dc41 Mon Sep 17 00:00:00 2001 From: Sami Alfattany Date: Wed, 11 Mar 2026 17:23:39 +0300 Subject: [PATCH 01/12] fix the CSRF token on delete files and directories --- .../templates/bootstrap4/admin/file/list.html | 8 +- flask_admin/tests/fileadmin/test_fileadmin.py | 127 ++++++++++++++++++ 2 files changed, 131 insertions(+), 4 deletions(-) diff --git a/flask_admin/templates/bootstrap4/admin/file/list.html b/flask_admin/templates/bootstrap4/admin/file/list.html index dc9be0191f..2b63f2cbf7 100644 --- a/flask_admin/templates/bootstrap4/admin/file/list.html +++ b/flask_admin/templates/bootstrap4/admin/file/list.html @@ -86,8 +86,8 @@ {% if name != '..' and admin_view.can_delete_dirs %}
{{ delete_form.path(value=path) }} - {% if delete_form.csrf_token is defined and delete_form.csrf_token %} - {{ delete_form.csrf_token }} + {% if csrf_token is defined and csrf_token %} + {% endif %}