mirror of
https://github.com/GSA/notifications-api.git
synced 2026-09-10 10:03:38 -04:00
Merge pull request #761 from alphagov/invite-expiry-msg
Invite expiry message
This commit is contained in:
@@ -33,7 +33,9 @@ def get_invited_user_by_token(token):
|
|||||||
current_app.config['DANGEROUS_SALT'],
|
current_app.config['DANGEROUS_SALT'],
|
||||||
max_age_seconds)
|
max_age_seconds)
|
||||||
except SignatureExpired:
|
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)
|
raise InvalidRequest(errors, status_code=400)
|
||||||
|
|
||||||
invited_user = get_invited_user_by_id(invited_user_id)
|
invited_user = get_invited_user_by_id(invited_user_id)
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
import pytest
|
|
||||||
from flask import json
|
from flask import json
|
||||||
from freezegun import freeze_time
|
from freezegun import freeze_time
|
||||||
from notifications_utils.url_safe_token import generate_token
|
from notifications_utils.url_safe_token import generate_token
|
||||||
@@ -20,7 +19,9 @@ def test_accept_invite_for_expired_token_returns_400(notify_api, sample_invited_
|
|||||||
assert response.status_code == 400
|
assert response.status_code == 400
|
||||||
json_resp = json.loads(response.get_data(as_text=True))
|
json_resp = json.loads(response.get_data(as_text=True))
|
||||||
assert json_resp['result'] == 'error'
|
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):
|
def test_accept_invite_returns_200_when_token_valid(notify_api, sample_invited_user):
|
||||||
|
|||||||
Reference in New Issue
Block a user