mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-03-24 09:21:08 +00:00
Merge code improvement from Anders Kaseorg
[ Anders Kaseorg ] * ubuntutools/lp/functions.py: - Simplify isLPTeamMember.
This commit is contained in:
commit
95708ccc3b
4
debian/changelog
vendored
4
debian/changelog
vendored
@ -41,6 +41,10 @@ ubuntu-dev-tools (0.74) UNRELEASED; urgency=low
|
|||||||
versions that end in buildX as valid Ubuntu versions, and thus allow it
|
versions that end in buildX as valid Ubuntu versions, and thus allow it
|
||||||
to work with fakesyncs. (LP: #376623)
|
to work with fakesyncs. (LP: #376623)
|
||||||
|
|
||||||
|
[ Anders Kaseorg ]
|
||||||
|
* ubuntutools/lp/functions.py:
|
||||||
|
- Simplify isLPTeamMember.
|
||||||
|
|
||||||
-- Nathan Handler <nhandler@ubuntu.com> Sat, 16 May 2009 19:09:21 +0000
|
-- Nathan Handler <nhandler@ubuntu.com> Sat, 16 May 2009 19:09:21 +0000
|
||||||
|
|
||||||
ubuntu-dev-tools (0.73) karmic; urgency=low
|
ubuntu-dev-tools (0.73) karmic; urgency=low
|
||||||
|
@ -143,23 +143,9 @@ def isLPTeamMember(team):
|
|||||||
|
|
||||||
If the user is a member of the team: return True.
|
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 user is not a member of the team: return False.
|
||||||
|
|
||||||
If the team is not found: raise a TeamNotFoundException.
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
try:
|
return any(t.name == team for t in launchpad.me.super_teams)
|
||||||
|
|
||||||
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)
|
|
||||||
|
|
||||||
def isPerPackageUploader(package):
|
def isPerPackageUploader(package):
|
||||||
# Checks if the user has upload privileges for a certain package.
|
# Checks if the user has upload privileges for a certain package.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user