~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-08-04 00:59:46 UTC
  • mto: (13627.2.1 bug-813322-2)
  • mto: This revision was merged to the branch mainline in revision 13715.
  • Revision ID: bac@canonical.com-20110804005946-030kaefvuljz5j3z
Horrible checkpoint

Show diffs side-by-side

added added

removed removed

Lines of Context:
77
77
from zope.event import notify
78
78
from zope.interface import (
79
79
    implements,
 
80
    implementsOnly,
80
81
    providedBy,
81
82
    )
82
83
from zope.security.proxy import (
134
135
    IBugMute,
135
136
    IBugSet,
136
137
    IFileBugData,
 
138
    IDeferredObjectModifiedEvent,
137
139
    )
138
140
from lp.bugs.interfaces.bugactivity import IBugActivitySet
139
141
from lp.bugs.interfaces.bugattachment import (
238
240
    tag = StringCol(notNull=True)
239
241
 
240
242
 
 
243
class DeferredObjectModifiedEvent(ObjectModifiedEvent):
 
244
    implementsOnly(IDeferredObjectModifiedEvent)
 
245
 
 
246
 
241
247
def get_bug_tags(context_clause):
242
248
    """Return all the bug tags as a list of strings.
243
249
 
1103
1109
 
1104
1110
    def addChange(self, change, recipients=None):
1105
1111
        """See `IBug`."""
 
1112
        import pdb; pdb.set_trace(); # DO NOT COMMIT
1106
1113
        when = change.when
1107
1114
        if when is None:
1108
1115
            when = UTC_NOW
1424
1431
        question = question_target.createQuestionFromBug(self)
1425
1432
        self.addChange(BugConvertedToQuestion(UTC_NOW, person, question))
1426
1433
        get_property_cache(self)._question_from_bug = question
1427
 
 
 
1434
        import pdb; pdb.set_trace(); # DO NOT COMMIT
1428
1435
        notify(BugBecameQuestionEvent(self, question, person))
1429
1436
        return question
1430
1437
 
1844
1851
                        duplicate, providing=providedBy(duplicate))
1845
1852
                    affected_targets.update(
1846
1853
                        duplicate._markAsDuplicate(duplicate_of))
1847
 
                    notify(ObjectModifiedEvent(
1848
 
                            duplicate, dupe_before, 'duplicateof'))
 
1854
 
 
1855
                    # At this point the event must be marked to indicate it
 
1856
                    # should not gather the recipents but be a deferred
 
1857
                    # event.
 
1858
                    notify(DeferredObjectModifiedEvent(
 
1859
                        duplicate, dupe_before, 'duplicateof'))
1849
1860
            self.duplicateof = duplicate_of
1850
1861
        except LaunchpadValidationError, validation_error:
1851
1862
            raise InvalidDuplicateValue(validation_error)
1868
1879
 
1869
1880
    def markAsDuplicate(self, duplicate_of):
1870
1881
        """See `IBug`."""
 
1882
        import pdb; pdb.set_trace(); # DO NOT COMMIT
1871
1883
        affected_targets = self._markAsDuplicate(duplicate_of)
1872
1884
        if duplicate_of is not None:
1873
1885
            duplicate_of.updateHeat(affected_targets)