Dont allow inviting members already on the team (including yourself.)

This commit is contained in:
Will O'Beirne 2019-03-18 12:51:46 -04:00
parent ba704f5f5c
commit b0c6614a64
No known key found for this signature in database
GPG Key ID: 44C190DB5DEAF9F6
1 changed files with 4 additions and 0 deletions

View File

@ -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