mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-23 15:57:23 -04:00
Update expired and cancelled service invite handling
This changeset adds a bit of extra handling for expired and cancelled service invites so that users can no longer accept them and are provided with more detailed error messages. Signed-off-by: Carlo Costino <carlo.costino@gsa.gov>
This commit is contained in:
@@ -251,10 +251,21 @@ def get_invited_user_email_address(invited_user_id):
|
|||||||
|
|
||||||
def invited_user_accept_invite(invited_user_id):
|
def invited_user_accept_invite(invited_user_id):
|
||||||
invited_user = InvitedUser.by_id(invited_user_id)
|
invited_user = InvitedUser.by_id(invited_user_id)
|
||||||
|
|
||||||
if invited_user.status == "expired":
|
if invited_user.status == "expired":
|
||||||
current_app.logger.error("User invitation has expired")
|
current_app.logger.error("User invitation has expired")
|
||||||
flash("Your invitation has expired.")
|
flash(
|
||||||
|
"Your invitation has expired; please contact the person who invited you for additional help."
|
||||||
|
)
|
||||||
abort(401)
|
abort(401)
|
||||||
|
|
||||||
|
if invited_user.status == "cancelled":
|
||||||
|
current_app.logger.error("User invitation has been cancelled")
|
||||||
|
flash(
|
||||||
|
"Your invitation is no longer valid; please contact the person who invited you for additional help."
|
||||||
|
)
|
||||||
|
abort(401)
|
||||||
|
|
||||||
invited_user.accept_invite()
|
invited_user.accept_invite()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user