sponsor-patch: Check permission to unsubscribe sponsors-team (LP: #896884)

This commit is contained in:
Andreas Moog 2011-11-27 16:47:38 +01:00
parent 20e757b2a5
commit 5f27c4c1e7
2 changed files with 11 additions and 6 deletions

6
debian/changelog vendored
View File

@ -1,5 +1,6 @@
ubuntu-dev-tools (0.137) UNRELEASED; urgency=low
[ Stefano Rivera ]
* mk-sbuild: Make --eatmydata command line flag actually work.
* Remove dgetlp. No longer needed.
* Use httplib2 everywhere that we do https. The python stdlib doesn't do
@ -15,7 +16,10 @@ ubuntu-dev-tools (0.137) UNRELEASED; urgency=low
* sponsor-patch: Check the bug's title, not the task, when determining
source series for syncs.
-- Stefano Rivera <stefanor@debian.org> Mon, 21 Nov 2011 09:47:00 +0200
[ Andreas Moog ]
* sponsor-patch: Check permission to unsubscribe sponsors-team (LP: #896884)
-- Andreas Moog <amoog@ubuntu.com> Sun, 27 Nov 2011 16:47:05 +0100
ubuntu-dev-tools (0.136) unstable; urgency=low

View File

@ -99,11 +99,12 @@ class SourcePackage(object):
bug.subscribe(person=launchpad.me)
Logger.info("Subscribed me to bug #%i.", bug.id)
if launchpad.load('https://api.launchpad.net/1.0/bugs/'+str(bug.id)+'/+subscription/ubuntu-sponsors').canBeUnsubscribedByUser():
bug.unsubscribe(person=launchpad.people['ubuntu-sponsors'])
Logger.info("Unsubscribed ubuntu-sponsors from bug #%i.", bug.id)
else:
Logger.info("Couldn't unsubscribe ubuntu-sponsors from bug #%i.", bug.id)
for sub in bug.subscriptions:
if sub.person == launchpad.people('ubuntu-sponsors') and sub.canBeUnsubscribedByUser():
bug.unsubscribe(person=launchpad.people['ubuntu-sponsors'])
Logger.info("Unsubscribed ubuntu-sponsors from bug #%i.", bug.id)
else:
Logger.info("Couldn't unsubscribe ubuntu-sponsors from bug #%i.", bug.id)
Logger.normal("Successfully acknowledged sync request bug #%i.",
bug.id)