From e993aa67054aa43854570861b4f005e780bdd3df Mon Sep 17 00:00:00 2001 From: Alexandru DAMIAN Date: Fri, 24 Jul 2015 16:05:20 +0100 Subject: bitbake: toaster: hide irrelevant builds in the project builds view This patch fixes the project builds view so it doesn't show "in progress" builds or builds for other projects. Note that this also modifies the "all builds" view to use the same queryset filtering as the project builds. This is to avoid excluding "in progress" builds more than once, which is what was happening before. The patch also has a minor change to ensure that when displaying the project builds page, only builds for that project are in the results. The queryset filtering is now split over several lines so you can see what's going on. [YOCTO #8236] [YOCTO #8187] (Bitbake rev: 771c08b9be1f7875e0216e381ab0a81ef0d26256) Signed-off-by: Alexandru DAMIAN Signed-off-by: Elliot Smith Signed-off-by: Richard Purdie --- bitbake/lib/toaster/toastergui/views.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'bitbake/lib/toaster/toastergui/views.py') diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py index d9802f01b8..8689a1251e 100755 --- a/bitbake/lib/toaster/toastergui/views.py +++ b/bitbake/lib/toaster/toastergui/views.py @@ -40,7 +40,7 @@ from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from django.http import HttpResponseBadRequest, HttpResponseNotFound from django.utils import timezone from django.utils.html import escape -from datetime import timedelta, datetime, date +from datetime import timedelta, datetime from django.utils import formats from toastergui.templatetags.projecttags import json as jsonfilter import json @@ -442,8 +442,7 @@ def _modify_date_range_filter(filter_string): def _add_daterange_context(queryset_all, request, daterange_list): # calculate the exact begining of local today and yesterday today_begin = timezone.localtime(timezone.now()) - today_begin = date(today_begin.year,today_begin.month,today_begin.day) - yesterday_begin = today_begin-timedelta(days=1) + yesterday_begin = today_begin - timedelta(days=1) # add daterange persistent context_date = {} context_date['last_date_from'] = request.GET.get('last_date_from',timezone.localtime(timezone.now()).strftime("%d/%m/%Y")) -- cgit v1.2.3-54-g00ecf