~launchpad-pqm/launchpad/devel

« back to all changes in this revision

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

  • Committer: Curtis Hovey
  • Date: 2011-07-28 17:18:23 UTC
  • mto: This revision was merged to the branch mainline in revision 13549.
  • Revision ID: curtis.hovey@canonical.com-20110728171823-d05ay9ijsrbnmos0
Always check for IDistroSeries before IDistribution since the former can
be adapted to the later.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1202
1202
 
1203
1203
    @property
1204
1204
    def series_list(self):
1205
 
        if IDistribution(self.context, None):
1206
 
            series = self.context.series
1207
 
        elif IProduct(self.context, None):
1208
 
            series = self.context.series
1209
 
        elif IDistroSeries(self.context, None):
 
1205
        if IDistroSeries(self.context, None):
1210
1206
            series = self.context.distribution.series
 
1207
        elif IDistribution(self.context, None):
 
1208
            series = self.context.series
 
1209
        elif IProduct(self.context, None):
 
1210
            series = self.context.series
1211
1211
        elif IProductSeries(self.context, None):
1212
1212
            series = self.context.product.series
1213
1213
        else:
1216
1216
 
1217
1217
    @property
1218
1218
    def milestones_list(self):
1219
 
        if IDistribution(self.context, None):
1220
 
            milestone_resultset = self.context.milestones
1221
 
        elif IProduct(self.context, None):
1222
 
            milestone_resultset = self.context.milestones
1223
 
        elif IDistroSeries(self.context, None):
 
1219
        if IDistroSeries(self.context, None):
1224
1220
            milestone_resultset = self.context.distribution.milestones
 
1221
        elif IDistribution(self.context, None):
 
1222
            milestone_resultset = self.context.milestones
 
1223
        elif IProduct(self.context, None):
 
1224
            milestone_resultset = self.context.milestones
1225
1225
        elif IProductSeries(self.context, None):
1226
1226
            milestone_resultset = self.context.product.milestones
1227
1227
        else:
1245
1245
        if not series_list:
1246
1246
            return series_buglistings
1247
1247
        # This would be better as delegation not a case statement.
1248
 
        if IDistribution(self.context, None):
 
1248
        if IDistroSeries(self.context, None):
 
1249
            backlink = BugSummary.distroseries_id
 
1250
        elif IDistribution(self.context, None):
1249
1251
            backlink = BugSummary.distroseries_id
1250
1252
        elif IProduct(self.context, None):
1251
1253
            backlink = BugSummary.productseries_id
1252
 
        elif IDistroSeries(self.context, None):
1253
 
            backlink = BugSummary.distroseries_id
1254
1254
        elif IProductSeries(self.context, None):
1255
1255
            backlink = BugSummary.productseries_id
1256
1256
        else: