Add in success flash message

This commit is contained in:
George Drummond 2019-06-07 10:59:40 -04:00
parent 5bcfcc1568
commit c08f14382f
No known key found for this signature in database
GPG Key ID: 296DD6077123BF17
3 changed files with 9 additions and 0 deletions

View File

@ -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"))

View File

@ -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",

View File

@ -6,6 +6,7 @@
{% block content %}
<main class="home">
{% include "fragments/flash.html" %}
{% if portfolios %}
{% set sticky_header = "home.new_portfolio" | translate %}