~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/code/model/sourcepackagerecipebuild.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-05-17 18:13:32 UTC
  • mfrom: (13001.7.6 778437-sprb-spam)
  • Revision ID: launchpad@pqm.canonical.com-20110517181332-4cwmr250kr4ehbno
[r=benji][bug=778437] don't send mail on successful recipe builds

Show diffs side-by-side

added added

removed removed

Lines of Context:
315
315
        # If our recipe has been deleted, any notification will fail.
316
316
        if self.recipe is None:
317
317
            return
 
318
        if self.status == BuildStatus.FULLYBUILT:
 
319
            # Don't send mail for successful recipe builds; it can be just
 
320
            # too much.
 
321
            return
318
322
        mailer = SourcePackageRecipeBuildMailer.forStatus(self)
319
323
        mailer.sendAll()
320
324
 
353
357
        except KeyError:
354
358
            raise NotFoundError(filename)
355
359
 
356
 
    def _handleStatus_OK(self, librarian, slave_status, logger,
357
 
                         send_notification):
358
 
        """See `IPackageBuild`."""
359
 
        d = super(SourcePackageRecipeBuild, self)._handleStatus_OK(
360
 
            librarian, slave_status, logger, send_notification)
361
 
 
362
 
        def uploaded_build(ignored):
363
 
            # Base implementation doesn't notify on success.
364
 
            if self.status == BuildStatus.FULLYBUILT and send_notification:
365
 
                self.notify()
366
 
        return d.addCallback(uploaded_build)
367
 
 
368
360
    def getUploader(self, changes):
369
361
        """See `IPackageBuild`."""
370
362
        return self.requester