Skip to content

Commit

Permalink
Merge 8c9e7b2 into 32a21bf
Browse files Browse the repository at this point in the history
  • Loading branch information
servingUpAces committed Dec 9, 2016
2 parents 32a21bf + 8c9e7b2 commit a719f77
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion app/accept_invite/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ def get_invited_user_by_token(token):
current_app.config['DANGEROUS_SALT'],
max_age_seconds)
except SignatureExpired:
errors = {'invitation': ['Invitation has expired']}
errors = {'invitation':
['Your invitation to GOV.UK Notify has expired. '
'Please ask the person that invited you to send you another one']}
raise InvalidRequest(errors, status_code=400)

invited_user = get_invited_user_by_id(invited_user_id)
Expand Down
5 changes: 3 additions & 2 deletions tests/app/accept_invite/test_accept_invite_rest.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import uuid

import pytest
from flask import json
from freezegun import freeze_time
from notifications_utils.url_safe_token import generate_token
Expand All @@ -20,7 +19,9 @@ def test_accept_invite_for_expired_token_returns_400(notify_api, sample_invited_
assert response.status_code == 400
json_resp = json.loads(response.get_data(as_text=True))
assert json_resp['result'] == 'error'
assert json_resp['message'] == {'invitation': ['Invitation has expired']}
assert json_resp['message'] == {'invitation': [
'Your invitation to GOV.UK Notify has expired. '
'Please ask the person that invited you to send you another one']}


def test_accept_invite_returns_200_when_token_valid(notify_api, sample_invited_user):
Expand Down

0 comments on commit a719f77

Please sign in to comment.