~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/bugs/model/bugtask.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-09-13 01:10:36 UTC
  • mfrom: (13916.1.4 bug-831991)
  • Revision ID: launchpad@pqm.canonical.com-20110913011036-wnxngs1mdtzks1e4
[r=benji][bug=831991] Janitor adds a bug comment when auto-confirming.

Show diffs side-by-side

added added

removed removed

Lines of Context:
843
843
            and self._checkAutoconfirmFeatureFlag()
844
844
            # END TEMPORARY BIT FOR BUGTASK AUTOCONFIRM FEATURE FLAG.
845
845
            ):
846
 
            user = getUtility(ILaunchpadCelebrities).janitor
 
846
            janitor = getUtility(ILaunchpadCelebrities).janitor
847
847
            bugtask_before_modification = Snapshot(
848
848
                self, providing=providedBy(self))
849
 
            self.transitionToStatus(BugTaskStatus.CONFIRMED, user)
 
849
            # Create a bug message explaining why the janitor auto-confirmed
 
850
            # the bugtask.
 
851
            msg = ("Status changed to 'Confirmed' because the bug "
 
852
                   "affects multiple users.")
 
853
            self.bug.newMessage(owner=janitor, content=msg)
 
854
            self.transitionToStatus(BugTaskStatus.CONFIRMED, janitor)
850
855
            notify(ObjectModifiedEvent(
851
 
                self, bugtask_before_modification, ['status'], user=user))
 
856
                self, bugtask_before_modification, ['status'], user=janitor))
852
857
 
853
858
    def canTransitionToStatus(self, new_status, user):
854
859
        """See `IBugTask`."""
1146
1151
        name in this distribution will have their names updated to
1147
1152
        match. This should only be used by _syncSourcePackages.
1148
1153
        """
1149
 
 
1150
1154
        if self.target == target:
1151
1155
            return
1152
1156