Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 10C7FE00A49; Thu, 15 Oct 2015 01:01:46 -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 * [134.134.136.65 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 437FEE00AC1 for ; Thu, 15 Oct 2015 01:01:44 -0700 (PDT) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP; 15 Oct 2015 01:01:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,684,1437462000"; d="scan'208";a="581183504" Received: from scotter-mobl1.ger.corp.intel.com (HELO lp.ger.corp.intel.com) ([10.252.22.76]) by FMSMGA003.fm.intel.com with ESMTP; 15 Oct 2015 01:01:43 -0700 From: Elliot Smith To: toaster@yoctoproject.org Date: Thu, 15 Oct 2015 09:01:23 +0100 Message-Id: <1444896084-9521-4-git-send-email-elliot.smith@intel.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1444896084-9521-1-git-send-email-elliot.smith@intel.com> References: <1444896084-9521-1-git-send-email-elliot.smith@intel.com> Subject: [review-request][PATCH 3/4] toaster: Guard against builds with no targets 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: Thu, 15 Oct 2015 08:01:46 -0000 Although this probably can't happen in practice (builds without targets), this constraint is not currently enforced in the data model. In the unlikely event that a build has no target (e.g. in test cases), this causes a template rendering error. Rather than rework the data model, add a guard to the template to prevent it from rendering the target name if there are no targets associated with the build. Signed-off-by: Elliot Smith --- bitbake/lib/toaster/toastergui/templates/builddashboard.html | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bitbake/lib/toaster/toastergui/templates/builddashboard.html b/bitbake/lib/toaster/toastergui/templates/builddashboard.html index 75ca8bc..c39fe34 100644 --- a/bitbake/lib/toaster/toastergui/templates/builddashboard.html +++ b/bitbake/lib/toaster/toastergui/templates/builddashboard.html @@ -3,7 +3,12 @@ {% load projecttags %} {% block parentbreadcrumb %} -{{build.get_sorted_target_list.0.target}} {%if build.target_set.all.count > 1%}(+ {{build.target_set.all.count|add:"-1"}}){%endif%} {{build.machine}} ({{build.completed_on|date:"d/m/y H:i"}}) +{% if build.get_sorted_target_list.count > 0 %} + {{build.get_sorted_target_list.0.target}} +   +{% endif %} + +{%if build.target_set.all.count > 1%}(+ {{build.target_set.all.count|add:"-1"}}){%endif%} {{build.machine}} ({{build.completed_on|date:"d/m/y H:i"}}) {% endblock %} {% block buildinfomain %} @@ -62,7 +67,7 @@
{% for error in build.errors %} -
+
{{error.message}}
{% endfor %} -- 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.