diff options
Diffstat (limited to 'bitbake/lib/toaster/toastergui/views.py')
-rwxr-xr-x | bitbake/lib/toaster/toastergui/views.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py index 2336ae3bec..00b1387d63 100755 --- a/bitbake/lib/toaster/toastergui/views.py +++ b/bitbake/lib/toaster/toastergui/views.py | |||
@@ -64,7 +64,9 @@ def _get_latest_builds(prj=None): | |||
64 | if prj is not None: | 64 | if prj is not None: |
65 | queryset = queryset.filter(project = prj) | 65 | queryset = queryset.filter(project = prj) |
66 | 66 | ||
67 | return itertools.chain(queryset.filter(outcome__lt=Build.IN_PROGRESS).order_by("-pk")[:3], queryset.filter(outcome=Build.IN_PROGRESS).order_by("-pk")) | 67 | return itertools.chain( |
68 | queryset.filter(outcome=Build.IN_PROGRESS).order_by("-pk"), | ||
69 | queryset.filter(outcome__lt=Build.IN_PROGRESS).order_by("-pk")[:3] ) | ||
68 | 70 | ||
69 | 71 | ||
70 | # a JSON-able dict of recent builds; for use in the Project page, xhr_ updates, and other places, as needed | 72 | # a JSON-able dict of recent builds; for use in the Project page, xhr_ updates, and other places, as needed |
@@ -76,7 +78,7 @@ def _project_recent_build_list(prj): | |||
76 | "id": x.pk, | 78 | "id": x.pk, |
77 | "targets" : map(lambda y: {"target": y.target, "task": y.task }, x.target_set.all()), # TODO: create the task entry in the Target table | 79 | "targets" : map(lambda y: {"target": y.target, "task": y.task }, x.target_set.all()), # TODO: create the task entry in the Target table |
78 | "status": x.get_current_status(), | 80 | "status": x.get_current_status(), |
79 | "errors": map(lambda y: {"type": y.lineno, "msg": y.message, "tb": y.pathname}, x.logmessage_set.filter(level__gte=LogMessage.WARNING)), | 81 | "errors": map(lambda y: {"type": y.lineno, "msg": y.message, "tb": y.pathname}, (x.logmessage_set.filter(level__gte=LogMessage.WARNING)|x.logmessage_set.filter(level=LogMessage.EXCEPTION))), |
80 | "updated": x.completed_on.strftime('%s')+"000", | 82 | "updated": x.completed_on.strftime('%s')+"000", |
81 | "command_time": (x.completed_on - x.started_on).total_seconds(), | 83 | "command_time": (x.completed_on - x.started_on).total_seconds(), |
82 | "br_page_url": reverse('buildrequestdetails', args=(x.project.id, x.pk) ), | 84 | "br_page_url": reverse('buildrequestdetails', args=(x.project.id, x.pk) ), |