~launchpad-pqm/launchpad/devel

« back to all changes in this revision

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

  • Committer: Gavin Panella
  • Date: 2010-08-24 10:32:39 UTC
  • mto: This revision was merged to the branch mainline in revision 11495.
  • Revision ID: gavin.panella@canonical.com-20100824103239-xnio7eq7vcrubd8x
Convert lp.bugs.model.bugtask to propertycache.

Show diffs side-by-side

added added

removed removed

Lines of Context:
59
59
    removeSecurityProxy,
60
60
    )
61
61
 
62
 
from canonical.cachedproperty import cache_property
63
62
from canonical.config import config
64
63
from canonical.database.constants import UTC_NOW
65
64
from canonical.database.datetimecol import UtcDateTimeCol
156
155
from lp.soyuz.interfaces.publishing import PackagePublishingStatus
157
156
from lp.soyuz.model.publishing import SourcePackagePublishingHistory
158
157
from lp.soyuz.model.sourcepackagerelease import SourcePackageRelease
 
158
from lp.services.propertycache import (
 
159
    IPropertyCache,
 
160
    )
159
161
 
160
162
 
161
163
debbugsseveritymap = {None:        BugTaskImportance.UNDECIDED,
1324
1326
    """
1325
1327
    userid = user.id
1326
1328
    def cache_user_can_view_bug(bugtask):
1327
 
        cache_property(bugtask.bug, '_cached_viewers', set([userid]))
 
1329
        IPropertyCache(bugtask.bug)._known_viewers = set([userid])
1328
1330
        return bugtask
1329
1331
    return cache_user_can_view_bug
1330
1332