Add success flash message
This commit is contained in:
parent
59327d4cea
commit
1bad32bcdb
@ -528,13 +528,13 @@ def resend_invite(application_id, application_role_id):
|
||||
@applications_bp.route(
|
||||
"/environments/<environment_id>/add_subscription", methods=["POST"]
|
||||
)
|
||||
# TODO: decide what perms are needed to create a subscription
|
||||
@user_can(Permissions.EDIT_ENVIRONMENT, message="create new environment subscription")
|
||||
def create_subscription(environment_id):
|
||||
environment = Environments.get(environment_id)
|
||||
|
||||
try:
|
||||
app.csp.cloud.create_subscription(environment)
|
||||
flash("environment_subscription_success", name=environment.displayname)
|
||||
|
||||
except GeneralCSPException:
|
||||
flash("environment_subscription_failure")
|
||||
|
@ -88,6 +88,11 @@ MESSAGES = {
|
||||
"message": "flash.environment.subscription_failure.message",
|
||||
"category": "error",
|
||||
},
|
||||
"environment_subscription_success": {
|
||||
"title": "flash.environment.subscription_success.title",
|
||||
"message": "flash.environment.subscription_success.message",
|
||||
"category": "success",
|
||||
},
|
||||
"form_errors": {
|
||||
"title": "flash.form.errors.title",
|
||||
"message": "flash.form.errors.message",
|
||||
|
@ -131,6 +131,9 @@ flash:
|
||||
subscription_failure:
|
||||
title: Environment subscription error
|
||||
message: An unexpected problem occurred with your request, please try again. If the problem persists, contact an administrator.
|
||||
subscription_success:
|
||||
title: Success!
|
||||
message: "A subscription has been added to {name} environment"
|
||||
form:
|
||||
errors:
|
||||
title: There were some errors
|
||||
|
Loading…
x
Reference in New Issue
Block a user