Merge lp:~joetalbott/qa-dashboard/eventstat_kpi_fix into lp:qa-dashboard

Proposed by Joe Talbott
Status: Merged
Approved by: Joe Talbott
Approved revision: 756
Merged at revision: 759
Proposed branch: lp:~joetalbott/qa-dashboard/eventstat_kpi_fix
Merge into: lp:qa-dashboard
Diff against target: 20 lines (+6/-2)
1 file modified
eventstat/dashboard.py (+6/-2)
To merge this branch: bzr merge lp:~joetalbott/qa-dashboard/eventstat_kpi_fix
Reviewer Review Type Date Requested Status
Paul Larson Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+228785@code.launchpad.net

Commit message

eventstat - Fix KPI page to avoid index error if no results are available.

Description of the change

eventstat - Fix KPI page to avoid index error if no results are available.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:756
http://s-jenkins.ubuntu-ci:8080/job/dashboard-ci/351/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/dashboard-ci/351/rebuild

review: Approve (continuous-integration)
Revision history for this message
Paul Larson (pwlars) wrote :

Looks good

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'eventstat/dashboard.py'
2--- eventstat/dashboard.py 2013-10-07 02:10:15 +0000
3+++ eventstat/dashboard.py 2014-07-30 03:49:22 +0000
4@@ -38,11 +38,15 @@
5 return self.IMPORTANCE_HIGH
6
7 def _get_latest_build_number(self):
8- latest_build_number = EventstatMetric.objects.filter(
9+ metrics = EventstatMetric.objects.filter(
10 publish=True,
11 name='total',
12 image__arch__isnull=False,
13- ).order_by('-image__build_number')[0].image.build_number
14+ ).order_by('-image__build_number')
15+
16+ latest_build_number = "None"
17+ if metrics.count() > 0:
18+ latest_build_number = metrics[0].image.build_number
19
20 return str(latest_build_number)
21

Subscribers

People subscribed via source and target branches