Add cancelled-invite html.

If a invited user accepts a cancelled invitation they are directed to a page telling them the invitation is cancelled.
Without this they were able to register and were added to the service.
This commit is contained in:
Rebecca Law
2016-03-04 14:42:52 +00:00
parent a974e6e157
commit 8074c6ea7f
5 changed files with 42 additions and 6 deletions

View File

@@ -2,7 +2,8 @@ from flask import (
redirect,
url_for,
session,
abort
abort,
render_template
)
from notifications_python_client.errors import HTTPError
@@ -20,6 +21,9 @@ def accept_invite(token):
try:
invited_user = invite_api_client.check_token(token)
if invited_user.status == 'cancelled':
return render_template('views/cancelled-invitation.html')
existing_user = user_api_client.get_user_by_email(invited_user.email_address)
if existing_user: