diff --git a/atst/routes/portfolios/index.py b/atst/routes/portfolios/index.py index 426b897a..851d5ae8 100644 --- a/atst/routes/portfolios/index.py +++ b/atst/routes/portfolios/index.py @@ -8,6 +8,7 @@ from atst.domain.reports import Reports from atst.domain.portfolios import Portfolios from atst.models.permissions import Permissions from atst.domain.authz.decorator import user_can_access_decorator as user_can +from atst.utils.flash import formatted_flash as flash @portfolios_bp.route("/portfolios") @@ -81,4 +82,6 @@ def reports(portfolio_id): def delete_portfolio(portfolio_id): Portfolios.delete(portfolio=g.portfolio) + flash("portfolio_deleted", portfolio_name=g.portfolio.name) + return redirect(url_for("atst.home")) diff --git a/atst/utils/flash.py b/atst/utils/flash.py index a7d5b52d..2b0bf61e 100644 --- a/atst/utils/flash.py +++ b/atst/utils/flash.py @@ -2,6 +2,11 @@ from flask import flash, render_template_string from atst.utils.localization import translate MESSAGES = { + "portfolio_deleted": { + "title_template": "Portfolio has been deleted", + "message_template": "Portfolio '{{portfolio_name}}' has been deleted", + "category": "success", + }, "application_environment_members_updated": { "title_template": "Application environment members updated", "message_template": "Application environment members have been updated", diff --git a/templates/home.html b/templates/home.html index f5b569da..516c9107 100644 --- a/templates/home.html +++ b/templates/home.html @@ -6,6 +6,7 @@ {% block content %}
+ {% include "fragments/flash.html" %} {% if portfolios %} {% set sticky_header = "home.new_portfolio" | translate %}