~launchpad-pqm/launchpad/devel

« back to all changes in this revision

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

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-12-13 15:39:25 UTC
  • mfrom: (14450.3.4 fix-expirable-bugs)
  • Revision ID: launchpad@pqm.canonical.com-20111213153925-2fts1x37x26jo43i
[r=bac][bug=900398] Fix +expirable-bugs with dynamic listings.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2067
2067
        The bugtarget may be an `IDistribution`, `IDistroSeries`, `IProduct`,
2068
2068
        or `IProductSeries`.
2069
2069
        """
2070
 
        days_old = config.malone.days_before_expiration
2071
 
 
2072
2070
        if target_has_expirable_bugs_listing(self.context):
2073
2071
            return getUtility(IBugTaskSet).findExpirableBugTasks(
2074
 
                days_old, user=self.user, target=self.context).count()
 
2072
                0, user=self.user, target=self.context).count()
2075
2073
        else:
2076
2074
            return None
2077
2075
 
4305
4303
    page_title = label
4306
4304
 
4307
4305
 
4308
 
class BugTaskExpirableListingView(LaunchpadView):
 
4306
class BugTaskExpirableListingView(BugTaskSearchListingView):
4309
4307
    """View for listing Incomplete bugs that can expire."""
4310
4308
 
4311
4309
    @property
4328
4326
        else:
4329
4327
            return ['id', 'summary', 'date_last_updated', 'heat']
4330
4328
 
4331
 
    @property
4332
4329
    def search(self):
4333
4330
        """Return an `ITableBatchNavigator` for the expirable bugtasks."""
4334
 
        days_old = config.malone.days_before_expiration
4335
4331
        bugtaskset = getUtility(IBugTaskSet)
4336
4332
        bugtasks = bugtaskset.findExpirableBugTasks(
4337
 
            days_old, user=self.user, target=self.context)
 
4333
            user=self.user, target=self.context, min_days_old=0)
4338
4334
        return BugListingBatchNavigator(
4339
4335
            bugtasks, self.request, columns_to_show=self.columns_to_show,
4340
4336
            size=config.malone.buglist_batch_size)