diff --git a/debian/changelog b/debian/changelog index eff8a70..0822596 100644 --- a/debian/changelog +++ b/debian/changelog @@ -30,6 +30,10 @@ ubuntu-dev-tools (0.74) UNRELEASED; urgency=low - Check if user has upload privileges instead of checking for team membership when seeing if operations are permitted + [ Anders Kaseorg ] + * ubuntutools/lp/functions.py: + - Simplify isLPTeamMember. + -- Iain Lane Sun, 10 May 2009 19:13:34 +0100 ubuntu-dev-tools (0.73) karmic; urgency=low diff --git a/ubuntutools/lp/functions.py b/ubuntutools/lp/functions.py index 3c2f7d2..95eacf4 100644 --- a/ubuntutools/lp/functions.py +++ b/ubuntutools/lp/functions.py @@ -143,23 +143,9 @@ def isLPTeamMember(team): If the user is a member of the team: return True. If the user is not a member of the team: return False. - - If the team is not found: raise a TeamNotFoundException. """ - try: - - lpteam = launchpad.people[team] - - if not lpteam.is_team: - raise KeyError - - return _findMember(lpteam, launchpad.me) - - except KeyError: - - raise TeamNotFoundException("The team %s does not exist on Launchpad" % - team) + return any(t.name == team for t in launchpad.me.super_teams) def isPerPackageUploader(package): # Checks if the user has upload privileges for a certain package.