diff options
author | Alexandru DAMIAN <alexandru.damian@intel.com> | 2015-07-24 16:05:20 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-09-19 11:31:59 +0100 |
commit | e993aa67054aa43854570861b4f005e780bdd3df (patch) | |
tree | 992b81e22520e5260ea3fbf65a1172938368eccd /bitbake/lib/toaster/toastergui/views.py | |
parent | 5b4e380b9b4335f4607d78d97345bbbda4c66e0e (diff) | |
download | poky-e993aa67054aa43854570861b4f005e780bdd3df.tar.gz |
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 <alexandru.damian@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/toastergui/views.py')
-rwxr-xr-x | bitbake/lib/toaster/toastergui/views.py | 5 |
1 files changed, 2 insertions, 3 deletions
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 | |||
40 | from django.http import HttpResponseBadRequest, HttpResponseNotFound | 40 | from django.http import HttpResponseBadRequest, HttpResponseNotFound |
41 | from django.utils import timezone | 41 | from django.utils import timezone |
42 | from django.utils.html import escape | 42 | from django.utils.html import escape |
43 | from datetime import timedelta, datetime, date | 43 | from datetime import timedelta, datetime |
44 | from django.utils import formats | 44 | from django.utils import formats |
45 | from toastergui.templatetags.projecttags import json as jsonfilter | 45 | from toastergui.templatetags.projecttags import json as jsonfilter |
46 | import json | 46 | import json |
@@ -442,8 +442,7 @@ def _modify_date_range_filter(filter_string): | |||
442 | def _add_daterange_context(queryset_all, request, daterange_list): | 442 | def _add_daterange_context(queryset_all, request, daterange_list): |
443 | # calculate the exact begining of local today and yesterday | 443 | # calculate the exact begining of local today and yesterday |
444 | today_begin = timezone.localtime(timezone.now()) | 444 | today_begin = timezone.localtime(timezone.now()) |
445 | today_begin = date(today_begin.year,today_begin.month,today_begin.day) | 445 | yesterday_begin = today_begin - timedelta(days=1) |
446 | yesterday_begin = today_begin-timedelta(days=1) | ||
447 | # add daterange persistent | 446 | # add daterange persistent |
448 | context_date = {} | 447 | context_date = {} |
449 | context_date['last_date_from'] = request.GET.get('last_date_from',timezone.localtime(timezone.now()).strftime("%d/%m/%Y")) | 448 | context_date['last_date_from'] = request.GET.get('last_date_from',timezone.localtime(timezone.now()).strftime("%d/%m/%Y")) |