mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-19 14:09:20 -04:00
Display email address that invitee will be registered with.
Also add flash message for users who already have an account.
This commit is contained in:
@@ -33,6 +33,7 @@ def accept_invite(token):
|
||||
session['invited_user'] = invited_user.serialize()
|
||||
|
||||
if existing_user:
|
||||
|
||||
user_api_client.add_user_to_service(invited_user.service,
|
||||
existing_user.id,
|
||||
invited_user.permissions)
|
||||
|
||||
@@ -51,7 +51,7 @@ def register_from_invite():
|
||||
form.service.data = invited_user['service']
|
||||
form.email_address.data = invited_user['email_address']
|
||||
|
||||
return render_template('views/register-from-invite.html', form=form)
|
||||
return render_template('views/register-from-invite.html', email_address=invited_user['email_address'], form=form)
|
||||
|
||||
|
||||
def _do_registration(form, service=None):
|
||||
|
||||
@@ -45,6 +45,11 @@ def sign_in():
|
||||
# Vague error message for login in case of user not known, locked, inactive or password not verified
|
||||
flash('Username or password is incorrect')
|
||||
|
||||
invited_user = session.get('invited_user')
|
||||
if invited_user:
|
||||
message = 'You already have an account with GOV.UK Notify. Sign in to your account to accept this invitation.'
|
||||
flash(message, 'default')
|
||||
|
||||
return render_template('views/signin.html', form=form)
|
||||
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ Create an account – GOV.UK Notify
|
||||
<div class="grid-row">
|
||||
<div class="column-two-thirds">
|
||||
<h1 class="heading-large">Create an account</h1>
|
||||
<p>Your account will be created with this email: {{email_address}}</p>
|
||||
<form method="post" autocomplete="nope">
|
||||
{{ textbox(form.name, width='3-4') }}
|
||||
{{ textbox(form.mobile_number, width='3-4') }}
|
||||
|
||||
Reference in New Issue
Block a user