diff --git a/swh/web/tests/deposit/test_app.py b/swh/web/tests/deposit/test_app.py --- a/swh/web/tests/deposit/test_app.py +++ b/swh/web/tests/deposit/test_app.py @@ -14,7 +14,7 @@ @pytest.mark.django_db -def test_deposit_deactivate(client, staff_user, django_settings): +def test_deposit_deactivate(client, admin_user, django_settings): """Check Add forge now feature is deactivated when the swh.web.deposit django application is not in installed apps.""" @@ -23,7 +23,7 @@ ] url = reverse("swh-web-homepage") - client.force_login(staff_user) + client.force_login(admin_user) resp = check_html_get_response(client, url, status_code=200) assert_not_contains(resp, "swh-deposit-admin-item") diff --git a/swh/web/webapp/templates/layout.html b/swh/web/webapp/templates/layout.html --- a/swh/web/webapp/templates/layout.html +++ b/swh/web/webapp/templates/layout.html @@ -249,13 +249,15 @@ {% endif %} {% endif %} - {% if "swh.web.deposit" in SWH_DJANGO_APPS and user.is_staff or ADMIN_LIST_DEPOSIT_PERMISSION in user.get_all_permissions %} - + {% if "swh.web.deposit" in SWH_DJANGO_APPS %} + {% if user.is_staff or ADMIN_LIST_DEPOSIT_PERMISSION in user.get_all_permissions %} + + {% endif %} {% endif %} {% if "swh.web.mailmap" in SWH_DJANGO_APPS and MAILMAP_ADMIN_PERMISSION in user.get_all_permissions %}