Maintient l'accès administrateur au setup
Some checks are pending
CI - Tests et Syntax / lint-and-test (push) Waiting to run
Some checks are pending
CI - Tests et Syntax / lint-and-test (push) Waiting to run
This commit is contained in:
parent
26979b2927
commit
358f946c76
2 changed files with 7 additions and 0 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
3
tests/integration/test_setup_admin_access.py
Normal file
3
tests/integration/test_setup_admin_access.py
Normal file
|
|
@ -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
|
||||
Loading…
Reference in a new issue