]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
toaster: Show correct builds count on project pages
authorElliot Smith <elliot.smith@intel.com>
Fri, 4 Sep 2015 09:37:45 +0000 (10:37 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 18 Sep 2015 08:04:25 +0000 (09:04 +0100)
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>
lib/toaster/toastergui/static/js/base.js
lib/toaster/toastergui/views.py

index e0df46397997c5ae64d3ba78f099596b342bd12b..895e61b2aae1f0f4f3537a5ccac06a1e02c0796b 100644 (file)
@@ -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);
     });
   }
 
index 45a561172460d9826a2ce8daa10d1babd9e41800..67c84b29342682a5ce77e540943f28c54e6892c5 100755 (executable)
@@ -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),