Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 5202AE00D5B; Fri, 4 Sep 2015 02:38:09 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high * trust * [192.55.52.93 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id CB937E00D52 for ; Fri, 4 Sep 2015 02:38:02 -0700 (PDT) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP; 04 Sep 2015 02:38:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,468,1437462000"; d="scan'208";a="638409658" Received: from unknown (HELO lp.ger.corp.intel.com) ([10.252.26.200]) by orsmga003.jf.intel.com with ESMTP; 04 Sep 2015 02:38:02 -0700 From: Elliot Smith To: toaster@yoctoproject.org Date: Fri, 4 Sep 2015 10:37:45 +0100 Message-Id: <1441359467-20711-4-git-send-email-elliot.smith@intel.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1441359467-20711-1-git-send-email-elliot.smith@intel.com> References: <1441359467-20711-1-git-send-email-elliot.smith@intel.com> Subject: [review-request][PATCH 3/5] toaster: Show correct builds count on project pages X-BeenThere: toaster@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Web based interface for BitBake List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Sep 2015 09:38:09 -0000 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 --- bitbake/lib/toaster/toastergui/static/js/base.js | 4 ++-- bitbake/lib/toaster/toastergui/views.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bitbake/lib/toaster/toastergui/static/js/base.js b/bitbake/lib/toaster/toastergui/static/js/base.js index e0df463..895e61b 100644 --- a/bitbake/lib/toaster/toastergui/static/js/base.js +++ b/bitbake/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/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py index 6ff510d..631d619 100755 --- a/bitbake/lib/toaster/toastergui/views.py +++ b/bitbake/lib/toaster/toastergui/views.py @@ -2255,7 +2255,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), -- Elliot Smith Software Engineer Intel OTC --------------------------------------------------------------------- Intel Corporation (UK) Limited Registered No. 1134945 (England) Registered Office: Pipers Way, Swindon SN3 1RJ VAT No: 860 2173 47 This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.