summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorAlexandru DAMIAN <alexandru.damian@intel.com>2015-03-25 13:34:27 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-03-31 22:30:04 +0100
commitc6ea812964df7768fed294f9736809c94076e811 (patch)
tree2ae3e387142d4011615f32943bda7fa7af3e9cdb /bitbake
parent0d0d02af4429bd0fd0e585e8474165be9cf1d6cf (diff)
downloadpoky-c6ea812964df7768fed294f9736809c94076e811.tar.gz
bitbake: toastergui: prevent error on empty build list
This patch prevents errors being thrown on date limit computations if the build list is empty. [YOCTO #7513] (Bitbake rev: d028fbe76962f3b86239633a0951626dfa66b8af) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rwxr-xr-xbitbake/lib/toaster/toastergui/views.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py
index fdd80222ab..2f8fb1a8e3 100755
--- a/bitbake/lib/toaster/toastergui/views.py
+++ b/bitbake/lib/toaster/toastergui/views.py
@@ -334,8 +334,14 @@ def _add_daterange_context(queryset_all, request, daterange_list):
334 context_date['daterange_filter']='' 334 context_date['daterange_filter']=''
335 for key in daterange_list: 335 for key in daterange_list:
336 queryset_key = queryset_all.order_by(key) 336 queryset_key = queryset_all.order_by(key)
337 context_date['dateMin_'+key]=timezone.localtime(getattr(queryset_key.first(),key)).strftime("%d/%m/%Y") 337 try:
338 context_date['dateMax_'+key]=timezone.localtime(getattr(queryset_key.last(),key)).strftime("%d/%m/%Y") 338 context_date['dateMin_'+key]=timezone.localtime(getattr(queryset_key.first(),key)).strftime("%d/%m/%Y")
339 except AttributeError:
340 context_date['dateMin_'+key]=timezone.localtime(timezone.now())
341 try:
342 context_date['dateMax_'+key]=timezone.localtime(getattr(queryset_key.last(),key)).strftime("%d/%m/%Y")
343 except AttributeError:
344 context_date['dateMax_'+key]=timezone.localtime(timezone.now())
339 return context_date,today_begin,yesterday_begin 345 return context_date,today_begin,yesterday_begin
340 346
341 347