diff options
Diffstat (limited to 'bitbake')
-rwxr-xr-x | bitbake/lib/toaster/toastergui/views.py | 10 |
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 | ||