From 358f946c762113254fc20f52e30f8382b3d371bc Mon Sep 17 00:00:00 2001 From: root Date: Fri, 14 Aug 2026 19:25:53 +0000 Subject: [PATCH] =?UTF-8?q?Maintient=20l'acc=C3=A8s=20administrateur=20au?= =?UTF-8?q?=20setup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app_new/core/routes/setup_wizard.py | 4 ++++ tests/integration/test_setup_admin_access.py | 3 +++ 2 files changed, 7 insertions(+) create mode 100644 tests/integration/test_setup_admin_access.py diff --git a/app_new/core/routes/setup_wizard.py b/app_new/core/routes/setup_wizard.py index bccb563..f99ac1f 100644 --- a/app_new/core/routes/setup_wizard.py +++ b/app_new/core/routes/setup_wizard.py @@ -31,6 +31,10 @@ def is_setup_complete(): @setup_wizard_bp.before_request def protect_initial_setup(): """Exige un jeton d'environnement tant que l'installation est incomplète.""" + # Le panneau de gestion reste accessible aux administrateurs connectés, + # même si le marqueur du volume instance a été perdu lors d'un redéploiement. + if request.endpoint == 'setup_wizard.admin_panel' and current_user.is_authenticated and current_user.is_admin(): + return None if is_setup_complete(): return None diff --git a/tests/integration/test_setup_admin_access.py b/tests/integration/test_setup_admin_access.py new file mode 100644 index 0000000..4189f5d --- /dev/null +++ b/tests/integration/test_setup_admin_access.py @@ -0,0 +1,3 @@ +def test_admin_panel_does_not_depend_on_setup_marker(authenticated_client): + response = authenticated_client.get('/setup-wizard/admin') + assert response.status_code == 200