Skip to content

Commit

Permalink
fix(#26) No more results with no prev results
Browse files Browse the repository at this point in the history
  • Loading branch information
tonythomas01 committed Oct 14, 2018
1 parent fe93f37 commit b9db17a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions dashboard/core/bots/reports/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def build_filters(self, is_improvement=True) -> dict:
'root_test__in': tests,
'bot__in': bot,
'browser__in': browsers,
'is_improvement': is_improvement
'is_improvement': is_improvement,
}


Expand All @@ -91,7 +91,8 @@ def get_queryset(self):
queryset = super(BotDataReportImprovementListView, self).get_queryset()
filter_params = self.build_filters(is_improvement=True)
limit = int(self.kwargs.get('limit', 10))
return queryset.filter(**filter_params).order_by('-delta')[:limit]
return queryset.filter(**filter_params).exclude(
prev_result__isnull=True).order_by('-delta')[:limit]


class BotDataReportRegressionListView(ReportDataBaseListViewSerializer):
Expand All @@ -102,7 +103,8 @@ def get_queryset(self):
queryset = super(BotDataReportRegressionListView, self).get_queryset()
filter_params = self.build_filters(is_improvement=False)
limit = int(self.kwargs.get('limit', 10))
return queryset.filter(**filter_params).order_by('-delta')[:limit]
return queryset.filter(**filter_params).exclude(
prev_result__isnull=True).order_by('-delta')[:limit]


class TestPathList(ListAPIView):
Expand Down

0 comments on commit b9db17a

Please sign in to comment.