~launchpad-pqm/launchpad/devel

« back to all changes in this revision

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

  • Committer: Brad Crittenden
  • Date: 2011-09-12 20:11:43 UTC
  • mto: This revision was merged to the branch mainline in revision 13931.
  • Revision ID: bac@canonical.com-20110912201143-h4zm38dbx3iozowv
RemoveĀ unneededĀ enum

Show diffs side-by-side

added added

removed removed

Lines of Context:
128
128
    SeriesNominated,
129
129
    UnsubscribedFromBug,
130
130
    )
131
 
from lp.bugs.enum import (
132
 
    BugAutoConfirmReason,
133
 
    BugNotificationLevel,
134
 
    )
 
131
from lp.bugs.enum import BugNotificationLevel
135
132
from lp.bugs.errors import InvalidDuplicateValue
136
133
from lp.bugs.interfaces.bug import (
137
134
    IBug,
1782
1779
        # step, but we will make some unnecessary comparisons.
1783
1780
        return self.users_affected_count_with_dupes > 1
1784
1781
 
1785
 
    def maybeConfirmBugtasks(self, reason):
 
1782
    def maybeConfirmBugtasks(self):
1786
1783
        """Maybe try to confirm our new bugtasks."""
1787
1784
        if self.shouldConfirmBugtasks():
1788
1785
            for bugtask in self.bugtasks:
1789
 
                bugtask.maybeConfirm(reason)
 
1786
                bugtask.maybeConfirm()
1790
1787
 
1791
1788
    def markUserAffected(self, user, affected=True):
1792
1789
        """See `IBug`."""
1805
1802
                dupe.markUserAffected(user, affected)
1806
1803
 
1807
1804
        if affected:
1808
 
            self.maybeConfirmBugtasks(
1809
 
                reason=BugAutoConfirmReason.AFFECTS_MULTIPLE_USERS)
 
1805
            self.maybeConfirmBugtasks()
1810
1806
 
1811
1807
        self.updateHeat()
1812
1808
 
1849
1845
            self.duplicateof = duplicate_of
1850
1846
        except LaunchpadValidationError, validation_error:
1851
1847
            raise InvalidDuplicateValue(validation_error)
1852
 
        import pdb; pdb.set_trace(); # DO NOT COMMIT
1853
1848
        if duplicate_of is not None:
1854
1849
            # Update the heat of the master bug and set this bug's heat
1855
1850
            # to 0 (since it's a duplicate, it shouldn't have any heat
1856
1851
            # at all).
1857
1852
            self.setHeat(0, affected_targets=affected_targets)
1858
1853
            # Maybe confirm bug tasks, now that it has a duplicate.
1859
 
            duplicate_of.maybeConfirmBugtasks(
1860
 
                reason=BugAutoConfirmReason.HAS_DUPLICATE)
 
1854
            duplicate_of.maybeConfirmBugtasks()
1861
1855
        else:
1862
1856
            # Otherwise, recalculate this bug's heat, since it will be 0
1863
1857
            # from having been a duplicate. We also update the bug that