mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-21 14:59:47 -04:00
Confirm edit user email changes user email
This commit is contained in:
@@ -1,4 +1,12 @@
|
||||
from flask import abort, flash, redirect, render_template, request, url_for, session
|
||||
from flask import (
|
||||
abort,
|
||||
flash,
|
||||
redirect,
|
||||
render_template,
|
||||
request,
|
||||
session,
|
||||
url_for,
|
||||
)
|
||||
from flask_login import current_user, login_required
|
||||
from notifications_python_client.errors import HTTPError
|
||||
|
||||
@@ -9,7 +17,12 @@ from app import (
|
||||
user_api_client,
|
||||
)
|
||||
from app.main import main
|
||||
from app.main.forms import InviteUserForm, PermissionsForm, SearchUsersForm, ChangeEmailForm
|
||||
from app.main.forms import (
|
||||
ChangeEmailForm,
|
||||
InviteUserForm,
|
||||
PermissionsForm,
|
||||
SearchUsersForm,
|
||||
)
|
||||
from app.models.user import permissions
|
||||
from app.utils import user_has_permissions
|
||||
|
||||
@@ -171,9 +184,11 @@ def confirm_edit_user_email(service_id, user_id):
|
||||
return render_template(
|
||||
'views/manage-users/confirm-edit-user-email.html',
|
||||
user=user,
|
||||
service_id=service_id
|
||||
service_id=service_id,
|
||||
new_email=new_email
|
||||
)
|
||||
|
||||
|
||||
@main.route("/services/<service_id>/cancel-invited-user/<invited_user_id>", methods=['GET'])
|
||||
@user_has_permissions('manage_service')
|
||||
def cancel_invited_user(service_id, invited_user_id):
|
||||
|
||||
@@ -135,6 +135,7 @@ class HeaderNavigation(Navigation):
|
||||
'choose_template',
|
||||
'choose_template_to_copy',
|
||||
'confirm_edit_organisation_name',
|
||||
'confirm_edit_user_email',
|
||||
'confirm_redact_template',
|
||||
'conversation',
|
||||
'conversation_reply',
|
||||
@@ -157,6 +158,7 @@ class HeaderNavigation(Navigation):
|
||||
'edit_service_template',
|
||||
'edit_template_postage',
|
||||
'edit_user_org_permissions',
|
||||
'edit_user_email',
|
||||
'edit_user_permissions',
|
||||
'email_not_received',
|
||||
'email_template',
|
||||
@@ -326,6 +328,8 @@ class MainNavigation(Navigation):
|
||||
'view_template_versions',
|
||||
},
|
||||
'team-members': {
|
||||
'confirm_edit_user_email',
|
||||
'edit_user_email',
|
||||
'edit_user_permissions',
|
||||
'invite_user',
|
||||
'manage_users',
|
||||
@@ -583,6 +587,7 @@ class CaseworkNavigation(Navigation):
|
||||
'choose_template_to_copy',
|
||||
'clear_cache',
|
||||
'confirm_edit_organisation_name',
|
||||
'confirm_edit_user_email',
|
||||
'confirm_redact_template',
|
||||
'conversation',
|
||||
'conversation_reply',
|
||||
@@ -607,6 +612,7 @@ class CaseworkNavigation(Navigation):
|
||||
'edit_provider',
|
||||
'edit_service_template',
|
||||
'edit_template_postage',
|
||||
'edit_user_email',
|
||||
'edit_user_org_permissions',
|
||||
'edit_user_permissions',
|
||||
'email_branding',
|
||||
@@ -822,6 +828,7 @@ class OrgNavigation(Navigation):
|
||||
'choose_template',
|
||||
'choose_template_to_copy',
|
||||
'clear_cache',
|
||||
'confirm_edit_user_email',
|
||||
'confirm_redact_template',
|
||||
'conversation',
|
||||
'conversation_reply',
|
||||
@@ -845,6 +852,7 @@ class OrgNavigation(Navigation):
|
||||
'edit_provider',
|
||||
'edit_service_template',
|
||||
'edit_template_postage',
|
||||
'edit_user_email',
|
||||
'edit_user_permissions',
|
||||
'email_branding',
|
||||
'email_not_received',
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
{% extends "org_template.html" %}
|
||||
{% from "components/page-footer.html" import page_footer %}
|
||||
{% from "components/form.html" import form_wrapper %}
|
||||
|
||||
{% block per_page_title %}
|
||||
Confirm changes to user email
|
||||
{% endblock %}
|
||||
|
||||
{% block maincolumn_content %}
|
||||
|
||||
<h1 class="heading-large">Confirm changes to user email</h1>
|
||||
|
||||
<div class="grid-row">
|
||||
<div class="column-three-quarters">
|
||||
|
||||
{% call form_wrapper() %}
|
||||
<p> Email address for {{ user.name }} will be changed from "{{ user.email_address }}" to "{{ new_email }}".</p>
|
||||
{{ page_footer(
|
||||
'Confirm',
|
||||
destructive=destructive,
|
||||
back_link=url_for('.edit_user_email', service_id=service_id, user_id=user.id)
|
||||
) }}
|
||||
{% endcall %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
@@ -1,15 +1,15 @@
|
||||
{% extends "withoutnav_template.html" %}
|
||||
{% extends "org_template.html" %}
|
||||
{% from "components/textbox.html" import textbox %}
|
||||
{% from "components/page-footer.html" import page_footer %}
|
||||
{% from "components/form.html" import form_wrapper %}
|
||||
|
||||
{% block per_page_title %}
|
||||
Edit user email
|
||||
Edit user email address
|
||||
{% endblock %}
|
||||
|
||||
{% block maincolumn_content %}
|
||||
|
||||
<h1 class="heading-large">Edit user email</h1>
|
||||
<h1 class="heading-large">Edit user email address</h1>
|
||||
<p id="user_name">for {{ user.name }}</p>
|
||||
<div class="grid-row">
|
||||
<div class="column-three-quarters">
|
||||
|
||||
Reference in New Issue
Block a user