diff --git a/app/main/views/invites.py b/app/main/views/invites.py index d6d496fe0..0df0306fb 100644 --- a/app/main/views/invites.py +++ b/app/main/views/invites.py @@ -9,6 +9,7 @@ from flask import ( from notifications_python_client.errors import HTTPError from app.main import main +from app.main.dao.services_dao import get_service_by_id_or_404 from app import ( invite_api_client, user_api_client @@ -22,7 +23,11 @@ def accept_invite(token): invited_user = invite_api_client.check_token(token) if invited_user.status == 'cancelled': - return render_template('views/cancelled-invitation.html') + from_user = user_api_client.get_user(invited_user.from_user) + service = get_service_by_id_or_404(invited_user.service) + return render_template('views/cancelled-invitation.html', + from_user=from_user.name, + service_name=service['name']) existing_user = user_api_client.get_user_by_email(invited_user.email_address) diff --git a/app/templates/views/cancelled-invitation.html b/app/templates/views/cancelled-invitation.html index d1b78cd3c..1e418505f 100644 --- a/app/templates/views/cancelled-invitation.html +++ b/app/templates/views/cancelled-invitation.html @@ -4,10 +4,13 @@
- The person that sent you the invitation decided that it was sent in error and has cancelled the invitation. + {{ from_user }} decided to cancel this invitation. +
++ If you need access to {{ service_name }}, you’ll have to ask them to invite you again.