When user not found, redirect to users page and show flash message
This commit is contained in:
@@ -43,8 +43,8 @@ def submit_new_user():
|
||||
new_user = Users.get_by_dod_id(request.form["dod_id"])
|
||||
form = CCPOUserForm(obj=new_user)
|
||||
except NotFoundError:
|
||||
new_user = None
|
||||
form = CCPOUserForm()
|
||||
flash("ccpo_user_not_found")
|
||||
return redirect(url_for("ccpo.users"))
|
||||
|
||||
return render_template("ccpo/confirm_user.html", new_user=new_user, form=form)
|
||||
|
||||
|
@@ -35,6 +35,11 @@ MESSAGES = {
|
||||
"message_template": "You have successfully given {{ user_name }} CCPO permissions.",
|
||||
"category": "success",
|
||||
},
|
||||
"ccpo_user_not_found": {
|
||||
"title_template": translate("ccpo.form.user_not_found_title"),
|
||||
"message_template": translate("ccpo.form.user_not_found_text"),
|
||||
"category": "info",
|
||||
},
|
||||
"environment_added": {
|
||||
"title_template": translate("flash.success"),
|
||||
"message_template": """
|
||||
|
Reference in New Issue
Block a user