mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-15 07:18:58 -04:00
Don’t error if email address hasn’t changed
When updating a user’s email address you currently get an validation error if you save without changing it. Instead it should just obey your command. And no need for the confirmation step because nothing is actually changing.
This commit is contained in:
@@ -146,6 +146,10 @@ def edit_user_email(service_id, user_id):
|
||||
return user_api_client.is_email_already_in_use(email)
|
||||
|
||||
form = ChangeEmailForm(_is_email_already_in_use, email_address=user_email)
|
||||
|
||||
if request.form.get('email_address', '').strip() == user_email:
|
||||
return redirect(url_for('.manage_users', service_id=current_service.id))
|
||||
|
||||
if form.validate_on_submit():
|
||||
session['team_member_email_change'] = form.email_address.data
|
||||
|
||||
|
||||
Reference in New Issue
Block a user