Wire up delete team UI

This commit is contained in:
Joseph Schorr 2013-11-05 14:53:48 -05:00
parent 6e2b2126a6
commit 1f44166311

View file

@ -292,7 +292,7 @@ def get_organization_private_allowed(orgname):
user = current_user.db_user()
try:
organization = model.get_organization(orgname, username = user.username)
organization = model.get_organization(orgname)
except:
abort(404)
@ -348,6 +348,17 @@ def update_organization_team(orgname, teamname):
abort(403)
@app.route('/api/organization/<orgname>/team/<teamname>',
methods=['DELETE'])
def delete_organization_team(orgname, teamname):
edit_permission = AdministerOrganizationPermission(orgname)
if edit_permission.can():
model.remove_team(teamname, orgname)
return make_response('Deleted', 204)
abort(403)
@app.route('/api/organization/<orgname>/team/<teamname>/members',
methods=['GET'])
def get_organization_team_members(orgname, teamname):
@ -420,10 +431,7 @@ def delete_organization_team_member(orgname, teamname, membername):
# Remote the user from the team.
model.remove_user_from_team(user, team)
return jsonify({
'success': True
})
return make_response('Deleted', 204)
abort(403)