From eb8b2b9ec89868b5f7191643276d226fcf4b5add Mon Sep 17 00:00:00 2001 From: Elliot Smith Date: Thu, 15 Oct 2015 15:45:15 +0300 Subject: bitbake: toaster: Guard against builds with no targets 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. (Bitbake rev: 4f409d8c01bae898ea142bd1417db99e12067753) Signed-off-by: Elliot Smith Signed-off-by: Ed Bartosh Signed-off-by: Richard Purdie --- bitbake/lib/toaster/toastergui/templates/builddashboard.html | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'bitbake') diff --git a/bitbake/lib/toaster/toastergui/templates/builddashboard.html b/bitbake/lib/toaster/toastergui/templates/builddashboard.html index 75ca8bc2c0..c39fe3457a 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 %} -- cgit v1.2.3-54-g00ecf