Merge pull request #403 from grant-project/no-invite-self

Prevent self invite
This commit is contained in:
Daniel Ternyak 2019-03-18 15:59:56 -05:00 committed by GitHub
commit a8d941d539
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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