From b0c6614a6454009990f073db88c803eaea4b36bb Mon Sep 17 00:00:00 2001 From: Will O'Beirne Date: Mon, 18 Mar 2019 12:51:46 -0400 Subject: [PATCH] Dont allow inviting members already on the team (including yourself.) --- backend/grant/proposal/views.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backend/grant/proposal/views.py b/backend/grant/proposal/views.py index 3893a98c..8064b501 100644 --- a/backend/grant/proposal/views.py +++ b/backend/grant/proposal/views.py @@ -379,6 +379,10 @@ def post_proposal_update(proposal_id, title, content): "address": fields.Str(required=True), }) def post_proposal_team_invite(proposal_id, address): + for u in g.current_proposal.team: + if address == u.email_address: + return {"message": f"Cannot invite members already on the team"}, 400 + existing_invite = ProposalTeamInvite.query.filter_by( proposal_id=proposal_id, address=address