diff --git a/AIPscan/Aggregator/templates/confirm.html b/AIPscan/Aggregator/templates/confirm.html new file mode 100644 index 00000000..fe9d13f6 --- /dev/null +++ b/AIPscan/Aggregator/templates/confirm.html @@ -0,0 +1,8 @@ +{% extends "base.html" %} + +{% block content %} +
+{% endblock %} diff --git a/AIPscan/Aggregator/tests/test_views.py b/AIPscan/Aggregator/tests/test_views.py index b806586c..e71d4b2c 100644 --- a/AIPscan/Aggregator/tests/test_views.py +++ b/AIPscan/Aggregator/tests/test_views.py @@ -51,21 +51,21 @@ def test_edit_storage_service(app_with_populated_files): def test_delete_storage_service(app_with_populated_files, mocker): with current_app.test_client() as test_client: - response = test_client.get("/aggregator/delete_storage_service/0") + response = test_client.get("/aggregator/delete_storage_service/0?confirm=1") assert response.status_code == 404 mocker.patch("AIPscan.Aggregator.tasks.delete_storage_service.delay") - response = test_client.get("/aggregator/delete_storage_service/1") + response = test_client.get("/aggregator/delete_storage_service/1?confirm=1") assert response.status_code == 302 def test_delete_fetch_job(app_with_populated_files, mocker): with current_app.test_client() as test_client: - response = test_client.get("/aggregator/delete_fetch_job/0") + response = test_client.get("/aggregator/delete_fetch_job/0?confirm=1") assert response.status_code == 404 mocker.patch("AIPscan.Aggregator.tasks.delete_fetch_job.delay") - response = test_client.get("/aggregator/delete_fetch_job/1") + response = test_client.get("/aggregator/delete_fetch_job/1?confirm=1") assert response.status_code == 302 diff --git a/AIPscan/Aggregator/views.py b/AIPscan/Aggregator/views.py index 619b2875..2d762d79 100644 --- a/AIPscan/Aggregator/views.py +++ b/AIPscan/Aggregator/views.py @@ -15,7 +15,7 @@ url_for, ) -from AIPscan import db, typesense_helpers +from AIPscan import db, decorators, typesense_helpers from AIPscan.Aggregator import database_helpers, tasks from AIPscan.Aggregator.forms import StorageServiceForm from AIPscan.Aggregator.task_helpers import ( @@ -171,6 +171,7 @@ def new_storage_service(): @aggregator.route("/delete_storage_service/