mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-24 01:11:38 -05:00
Fix a bug in the accept invitation that was throwing a 500.
- If the token for invitation was expired, the method would throw a 500 while creating the erorr message. - Added unit tests.
This commit is contained in:
@@ -33,8 +33,7 @@ def get_invited_user_by_token(token):
|
||||
current_app.config['DANGEROUS_SALT'],
|
||||
max_age_seconds)
|
||||
except SignatureExpired:
|
||||
message = 'Invitation with id {} expired'.format(invited_user_id)
|
||||
errors = {'invitation': [message]}
|
||||
errors = {'invitation': ['Invitation has expired']}
|
||||
raise InvalidRequest(errors, status_code=400)
|
||||
|
||||
invited_user = get_invited_user_by_id(invited_user_id)
|
||||
|
||||
Reference in New Issue
Block a user