summaryrefslogtreecommitdiff
path: root/lib/toaster
diff options
context:
space:
mode:
authorElliot Smith <elliot.smith@intel.com>2015-09-04 10:37:45 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-09-18 09:04:25 +0100
commit455a0087e0dcd74998abd02a110942f25da127be (patch)
tree90992108c712957ac1cc667ac5a4a76a6e478d86 /lib/toaster
parent09079f15c0511a6d17ce1cc29be6de5387e45f09 (diff)
downloadbitbake-455a0087e0dcd74998abd02a110942f25da127be.zip
toaster: Show correct builds count on project pages
The counter for completed builds on the project pages includes builds in progress. Instead use the completedbuilds queryset to count the number of completed builds for display on project pages. Modify how the completedbuilds queryset is constructed so it only excludes builds with status "in progress". Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/toaster')
-rw-r--r--lib/toaster/toastergui/static/js/base.js4
-rwxr-xr-xlib/toaster/toastergui/views.py2
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/toaster/toastergui/static/js/base.js b/lib/toaster/toastergui/static/js/base.js
index e0df4639..895e61b2 100644
--- a/lib/toaster/toastergui/static/js/base.js
+++ b/lib/toaster/toastergui/static/js/base.js
@@ -57,8 +57,8 @@ function basePageInit(ctx) {
if ($(".total-builds").length !== 0){
libtoaster.getProjectInfo(libtoaster.ctx.projectPageUrl, function(prjInfo){
- if (prjInfo.builds)
- $(".total-builds").text(prjInfo.builds.length);
+ if (prjInfo.completedbuilds)
+ $(".total-builds").text(prjInfo.completedbuilds.length);
});
}
diff --git a/lib/toaster/toastergui/views.py b/lib/toaster/toastergui/views.py
index 45a56117..67c84b29 100755
--- a/lib/toaster/toastergui/views.py
+++ b/lib/toaster/toastergui/views.py
@@ -2263,7 +2263,7 @@ if True:
context = {
"project" : prj,
"lvs_nos" : Layer_Version.objects.all().count(),
- "completedbuilds": Build.objects.filter(project_id = pid).filter(outcome__lte = Build.IN_PROGRESS),
+ "completedbuilds": Build.objects.exclude(outcome = Build.IN_PROGRESS).filter(project_id = pid),
"prj" : {"name": prj.name, },
"buildrequests" : prj.build_set.filter(outcome=Build.IN_PROGRESS),
"builds" : _project_recent_build_list(prj),