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:17 +0100
commit3ff649953d836efe3089e42f8f11a4c6abe648be (patch)
tree81a1cf521ce2b010eefb2041d0a007c1d352e615 /bitbake
parent8db54a9cfafcacd90e535d7ef2458ba6e4be7701 (diff)
downloadast2050-yocto-poky-3ff649953d836efe3089e42f8f11a4c6abe648be.zip
ast2050-yocto-poky-3ff649953d836efe3089e42f8f11a4c6abe648be.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: 8068539b6c2913fed66a865b547a653159d8c794) 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 fdd8022..2f8fb1a 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):
context_date['daterange_filter']=''
for key in daterange_list:
queryset_key = queryset_all.order_by(key)
- context_date['dateMin_'+key]=timezone.localtime(getattr(queryset_key.first(),key)).strftime("%d/%m/%Y")
- context_date['dateMax_'+key]=timezone.localtime(getattr(queryset_key.last(),key)).strftime("%d/%m/%Y")
+ try:
+ context_date['dateMin_'+key]=timezone.localtime(getattr(queryset_key.first(),key)).strftime("%d/%m/%Y")
+ except AttributeError:
+ context_date['dateMin_'+key]=timezone.localtime(timezone.now())
+ try:
+ context_date['dateMax_'+key]=timezone.localtime(getattr(queryset_key.last(),key)).strftime("%d/%m/%Y")
+ except AttributeError:
+ context_date['dateMax_'+key]=timezone.localtime(timezone.now())
return context_date,today_begin,yesterday_begin
OpenPOWER on IntegriCloud