Exemple #1
0
def delete_team_user_invite(team, user_obj):
    try:
        found = TeamMemberInvite.get(TeamMemberInvite.user == user_obj,
                                     TeamMemberInvite.team == team)
    except TeamMemberInvite.DoesNotExist:
        return False

    found.delete_instance()
    return True
Exemple #2
0
def delete_team_email_invite(team, email):
    try:
        found = TeamMemberInvite.get(TeamMemberInvite.email == email,
                                     TeamMemberInvite.team == team)
    except TeamMemberInvite.DoesNotExist:
        return False

    found.delete_instance()
    return True
Exemple #3
0
def lookup_team_invite(code, user_obj=None):
    # Lookup the invite code.
    try:
        found = TeamMemberInvite.get(TeamMemberInvite.invite_token == code)
    except TeamMemberInvite.DoesNotExist:
        raise DataModelException("Invalid confirmation code.")

    if user_obj and found.user != user_obj:
        raise DataModelException("Invalid confirmation code.")

    return found