Merge lp:~stevenk/launchpad/auditor-on-packageupload-reject into lp:launchpad

Proposed by Steve Kowalik
Status: Merged
Approved by: Steve Kowalik
Approved revision: no longer in the source branch.
Merged at revision: 15795
Proposed branch: lp:~stevenk/launchpad/auditor-on-packageupload-reject
Merge into: lp:launchpad
Diff against target: 56 lines (+9/-5)
3 files modified
lib/lp/soyuz/browser/queue.py (+3/-3)
lib/lp/soyuz/interfaces/queue.py (+2/-1)
lib/lp/soyuz/model/queue.py (+4/-1)
To merge this branch: bzr merge lp:~stevenk/launchpad/auditor-on-packageupload-reject
Reviewer Review Type Date Requested Status
Ian Booth (community) Approve
Review via email: mp+119291@code.launchpad.net

Description of the change

Copying the work done on IPackageUpload.acceptFromQueue(), do the same on IPackageUpload.rejectFromQueue().

Also correct a quite amusing docstring flip in QueueItemsView.

To post a comment you must log in.
Revision history for this message
Ian Booth (wallyworld) wrote :

Looks ok to my untrained eye

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/soyuz/browser/queue.py'
2--- lib/lp/soyuz/browser/queue.py 2012-08-08 16:34:39 +0000
3+++ lib/lp/soyuz/browser/queue.py 2012-08-13 02:03:23 +0000
4@@ -452,12 +452,12 @@
5 self.request.response.redirect(url)
6
7 def queue_action_accept(self, queue_item):
8- """Reject the queue item passed."""
9+ """Accept the queue item passed."""
10 queue_item.acceptFromQueue(user=self.user)
11
12 def queue_action_reject(self, queue_item):
13- """Accept the queue item passed."""
14- queue_item.rejectFromQueue()
15+ """Reject the queue item passed."""
16+ queue_item.rejectFromQueue(user=self.user)
17
18 def sortedSections(self):
19 """Possible sections for the context distroseries.
20
21=== modified file 'lib/lp/soyuz/interfaces/queue.py'
22--- lib/lp/soyuz/interfaces/queue.py 2012-08-08 16:34:39 +0000
23+++ lib/lp/soyuz/interfaces/queue.py 2012-08-13 02:03:23 +0000
24@@ -370,7 +370,8 @@
25
26 @export_write_operation()
27 @operation_for_version("devel")
28- def rejectFromQueue(logger=None, dry_run=False):
29+ @call_with(user=REQUEST_USER)
30+ def rejectFromQueue(logger=None, dry_run=False, user=None):
31 """Call setRejected, do a syncUpdate, and send notification email."""
32
33 def realiseUpload(logger=None):
34
35=== modified file 'lib/lp/soyuz/model/queue.py'
36--- lib/lp/soyuz/model/queue.py 2012-08-06 09:29:34 +0000
37+++ lib/lp/soyuz/model/queue.py 2012-08-13 02:03:23 +0000
38@@ -646,7 +646,7 @@
39 'Source is mandatory for delayed copies.')
40 self.setAccepted()
41
42- def rejectFromQueue(self, logger=None, dry_run=False):
43+ def rejectFromQueue(self, logger=None, dry_run=False, user=None):
44 """See `IPackageUpload`."""
45 self.setRejected()
46 if self.package_copy_job is not None:
47@@ -671,6 +671,9 @@
48 logger=logger, dry_run=dry_run,
49 changes_file_object=changes_file_object)
50 self.syncUpdate()
51+ if bool(getFeatureFlag('auditor.enabled')):
52+ client = AuditorClient()
53+ client.send(self, 'packageupload-rejected', user)
54
55 @property
56 def is_delayed_copy(self):