mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-24 08:16:51 -04:00
Short circuit if team member is already invited
It would be confusing if people got invited twice, so let’s tell people if someone’s has a pending invite.
This commit is contained in:
@@ -65,7 +65,10 @@ def invite_user(service_id, user_id=None):
|
||||
|
||||
if user_id:
|
||||
user_to_invite = User.from_id(user_id)
|
||||
if user_to_invite.belongs_to_service(current_service.id):
|
||||
if (
|
||||
user_to_invite.belongs_to_service(current_service.id)
|
||||
or current_service.invite_pending_for(user_to_invite.email_address)
|
||||
):
|
||||
return render_template(
|
||||
'views/user-already-invited.html',
|
||||
user_to_invite=user_to_invite,
|
||||
|
||||
Reference in New Issue
Block a user