Exception Investigation: app.notify_client:InviteTokenError

This commit is contained in:
Kenneth Kehl
2024-05-16 09:11:11 -07:00
parent 6bab682edd
commit e660541e9c
2 changed files with 6 additions and 2 deletions

View File

@@ -244,9 +244,11 @@ def get_invited_user_email_address(invited_user_id):
def invited_user_accept_invite(invited_user_id):
# InvitedUser is an unhashable type and hard to mock in tests
# so this convenience method is a workaround for that
invited_user = InvitedUser.by_id(invited_user_id)
if invited_user.status == "expired":
current_app.logger.error("User invitation has expired")
flash("Your invitation has expired.")
abort(401)
invited_user.accept_invite()