← Back to team overview

launchpad-reviewers team mailing list archive

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

 

Steve Kowalik has proposed merging lp:~stevenk/launchpad/auditor-on-packageupload-reject into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #885739 in Launchpad itself: "queue and override manipulations should have an audit trail"
  https://bugs.launchpad.net/launchpad/+bug/885739

For more details, see:
https://code.launchpad.net/~stevenk/launchpad/auditor-on-packageupload-reject/+merge/119291

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

Also correct a quite amusing docstring flip in QueueItemsView.
-- 
https://code.launchpad.net/~stevenk/launchpad/auditor-on-packageupload-reject/+merge/119291
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~stevenk/launchpad/auditor-on-packageupload-reject into lp:launchpad.
=== modified file 'lib/lp/soyuz/browser/queue.py'
--- lib/lp/soyuz/browser/queue.py	2012-08-08 16:34:39 +0000
+++ lib/lp/soyuz/browser/queue.py	2012-08-13 02:03:23 +0000
@@ -452,12 +452,12 @@
         self.request.response.redirect(url)
 
     def queue_action_accept(self, queue_item):
-        """Reject the queue item passed."""
+        """Accept the queue item passed."""
         queue_item.acceptFromQueue(user=self.user)
 
     def queue_action_reject(self, queue_item):
-        """Accept the queue item passed."""
-        queue_item.rejectFromQueue()
+        """Reject the queue item passed."""
+        queue_item.rejectFromQueue(user=self.user)
 
     def sortedSections(self):
         """Possible sections for the context distroseries.

=== modified file 'lib/lp/soyuz/interfaces/queue.py'
--- lib/lp/soyuz/interfaces/queue.py	2012-08-08 16:34:39 +0000
+++ lib/lp/soyuz/interfaces/queue.py	2012-08-13 02:03:23 +0000
@@ -370,7 +370,8 @@
 
     @export_write_operation()
     @operation_for_version("devel")
-    def rejectFromQueue(logger=None, dry_run=False):
+    @call_with(user=REQUEST_USER)
+    def rejectFromQueue(logger=None, dry_run=False, user=None):
         """Call setRejected, do a syncUpdate, and send notification email."""
 
     def realiseUpload(logger=None):

=== modified file 'lib/lp/soyuz/model/queue.py'
--- lib/lp/soyuz/model/queue.py	2012-08-06 09:29:34 +0000
+++ lib/lp/soyuz/model/queue.py	2012-08-13 02:03:23 +0000
@@ -646,7 +646,7 @@
             'Source is mandatory for delayed copies.')
         self.setAccepted()
 
-    def rejectFromQueue(self, logger=None, dry_run=False):
+    def rejectFromQueue(self, logger=None, dry_run=False, user=None):
         """See `IPackageUpload`."""
         self.setRejected()
         if self.package_copy_job is not None:
@@ -671,6 +671,9 @@
             logger=logger, dry_run=dry_run,
             changes_file_object=changes_file_object)
         self.syncUpdate()
+        if bool(getFeatureFlag('auditor.enabled')):
+            client = AuditorClient()
+            client.send(self, 'packageupload-rejected', user)
 
     @property
     def is_delayed_copy(self):


Follow ups