Remove my team from a super team

Created by Curtis Hovey on on 2013-01-28
Keywords:
retract remove leave team

It is not possible to retract your team's membership in another team using the web UI. You can ask a team admin in the other team to remove your team or if you are an admin of your team, you can use an API script to retractTeamMembership(). I use the API often. Here is a script that will permit the owner a team to remove it from another team's members:

#!/usr/bin/python
# Requires launchpadlib which Ubuntu users can get by running
# sudo apt-get install launchpadlib
# from a terminal.

from launchpadlib.launchpad import Launchpad

lp = Launchpad.login_with(
    'retract-team-membership',
    service_root='https://api.launchpad.net',
    version='devel')
my_team = lp.people['MY-TEAM']
other_team = lp.people['OTHER-TEAM']
my_team.retractTeamMembership(team=other_team)