mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-03-28 19:31:07 +00:00
* lpapiwrapper.py:
Move isLpTeamMember from LpApiWrapper to PersonTeam where it belongs
This commit is contained in:
parent
d63b782aec
commit
046798d12b
2
buildd
2
buildd
@ -122,7 +122,7 @@ component = sources.getComponent()
|
|||||||
|
|
||||||
# Operations that are remaining may only be done by Ubuntu developers (retry)
|
# Operations that are remaining may only be done by Ubuntu developers (retry)
|
||||||
# or buildd admins (rescore). Check if the proper permissions are in place.
|
# or buildd admins (rescore). Check if the proper permissions are in place.
|
||||||
if op == "rescore": necessaryPrivs = lpapiwrapper.isLpTeamMember('launchpad-buildd-admins')
|
if op == "rescore": necessaryPrivs = lpapiwrapper.getMe().isLpTeamMember('launchpad-buildd-admins')
|
||||||
if op == "retry": necessaryPrivs = lpapiwrapper.canUploadPackage(package, release)
|
if op == "retry": necessaryPrivs = lpapiwrapper.canUploadPackage(package, release)
|
||||||
|
|
||||||
if op in ('rescore', 'retry') and not necessaryPrivs:
|
if op in ('rescore', 'retry') and not necessaryPrivs:
|
||||||
|
@ -363,7 +363,7 @@ def post_bug(source_package, subscribe, status, bugtitle, bugtext):
|
|||||||
#newly created bugreports have one task
|
#newly created bugreports have one task
|
||||||
task = bug.bug_tasks[0]
|
task = bug.bug_tasks[0]
|
||||||
# Only members of ubuntu-bugcontrol can set importance
|
# Only members of ubuntu-bugcontrol can set importance
|
||||||
if LpApiWrapper.isLpTeamMember('ubuntu-bugcontrol'):
|
if LpApiWrapper.getMe().isLpTeamMember('ubuntu-bugcontrol'):
|
||||||
task.importance = 'Wishlist'
|
task.importance = 'Wishlist'
|
||||||
task.status = status
|
task.status = status
|
||||||
task.lp_save()
|
task.lp_save()
|
||||||
|
@ -221,15 +221,6 @@ class LpApiWrapper(object):
|
|||||||
|
|
||||||
return cls.canUploadPackage(package, series) and pkg in cls._upload_pkg
|
return cls.canUploadPackage(package, series) and pkg in cls._upload_pkg
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def isLpTeamMember(cls, team):
|
|
||||||
'''
|
|
||||||
Checks if the user is a member of a certain team on Launchpad.
|
|
||||||
|
|
||||||
Returns True if the user is a member of the team otherwise False.
|
|
||||||
'''
|
|
||||||
return any(t.name == team for t in cls.getMe().super_teams)
|
|
||||||
|
|
||||||
|
|
||||||
class MetaWrapper(type):
|
class MetaWrapper(type):
|
||||||
'''
|
'''
|
||||||
@ -373,3 +364,11 @@ class PersonTeam(BaseWrapper):
|
|||||||
if not cached:
|
if not cached:
|
||||||
cached = PersonTeam(Launchpad.people[person_or_team])
|
cached = PersonTeam(Launchpad.people[person_or_team])
|
||||||
return cached
|
return cached
|
||||||
|
|
||||||
|
def isLpTeamMember(self, team):
|
||||||
|
'''
|
||||||
|
Checks if the user is a member of a certain team on Launchpad.
|
||||||
|
|
||||||
|
Returns True if the user is a member of the team otherwise False.
|
||||||
|
'''
|
||||||
|
return any(t.name == team for t in self.super_teams)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user