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(
|
@applications_bp.route(
|
||||||
"/environments/<environment_id>/add_subscription", methods=["POST"]
|
"/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")
|
@user_can(Permissions.EDIT_ENVIRONMENT, message="create new environment subscription")
|
||||||
def create_subscription(environment_id):
|
def create_subscription(environment_id):
|
||||||
environment = Environments.get(environment_id)
|
environment = Environments.get(environment_id)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
app.csp.cloud.create_subscription(environment)
|
app.csp.cloud.create_subscription(environment)
|
||||||
|
flash("environment_subscription_success", name=environment.displayname)
|
||||||
|
|
||||||
except GeneralCSPException:
|
except GeneralCSPException:
|
||||||
flash("environment_subscription_failure")
|
flash("environment_subscription_failure")
|
||||||
|
@ -88,6 +88,11 @@ MESSAGES = {
|
|||||||
"message": "flash.environment.subscription_failure.message",
|
"message": "flash.environment.subscription_failure.message",
|
||||||
"category": "error",
|
"category": "error",
|
||||||
},
|
},
|
||||||
|
"environment_subscription_success": {
|
||||||
|
"title": "flash.environment.subscription_success.title",
|
||||||
|
"message": "flash.environment.subscription_success.message",
|
||||||
|
"category": "success",
|
||||||
|
},
|
||||||
"form_errors": {
|
"form_errors": {
|
||||||
"title": "flash.form.errors.title",
|
"title": "flash.form.errors.title",
|
||||||
"message": "flash.form.errors.message",
|
"message": "flash.form.errors.message",
|
||||||
|
@ -131,6 +131,9 @@ flash:
|
|||||||
subscription_failure:
|
subscription_failure:
|
||||||
title: Environment subscription error
|
title: Environment subscription error
|
||||||
message: An unexpected problem occurred with your request, please try again. If the problem persists, contact an administrator.
|
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:
|
form:
|
||||||
errors:
|
errors:
|
||||||
title: There were some errors
|
title: There were some errors
|
||||||
|
Loading…
x
Reference in New Issue
Block a user