diff options
Diffstat (limited to 'bitbake/lib/toaster')
-rwxr-xr-x | bitbake/lib/toaster/toastergui/views.py | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py index 10bbef5ca4..d675f4f2d2 100755 --- a/bitbake/lib/toaster/toastergui/views.py +++ b/bitbake/lib/toaster/toastergui/views.py | |||
@@ -92,9 +92,12 @@ def _get_latest_builds(prj=None): | |||
92 | if prj is not None: | 92 | if prj is not None: |
93 | queryset = queryset.filter(project = prj) | 93 | queryset = queryset.filter(project = prj) |
94 | 94 | ||
95 | if not toastermain.settings.BUILD_MODE: | ||
96 | queryset = queryset.exclude(project__is_default=False) | ||
97 | |||
95 | return list(itertools.chain( | 98 | return list(itertools.chain( |
96 | queryset.filter(outcome=Build.IN_PROGRESS).order_by("-pk"), | 99 | queryset.filter(outcome=Build.IN_PROGRESS).order_by("-started_on"), |
97 | queryset.filter(outcome__lt=Build.IN_PROGRESS).order_by("-pk")[:3] )) | 100 | queryset.filter(outcome__lt=Build.IN_PROGRESS).order_by("-started_on")[:3] )) |
98 | 101 | ||
99 | 102 | ||
100 | # a JSON-able dict of recent builds; for use in the Project page, xhr_ updates, and other places, as needed | 103 | # a JSON-able dict of recent builds; for use in the Project page, xhr_ updates, and other places, as needed |
@@ -1926,6 +1929,11 @@ if True: | |||
1926 | 1929 | ||
1927 | queryset = Build.objects.all() | 1930 | queryset = Build.objects.all() |
1928 | 1931 | ||
1932 | # if in analysis mode, exclude builds for all projects except | ||
1933 | # command line builds | ||
1934 | if not toastermain.settings.BUILD_MODE: | ||
1935 | queryset = queryset.exclude(project__is_default=False) | ||
1936 | |||
1929 | redirect_page = resolve(request.path_info).url_name | 1937 | redirect_page = resolve(request.path_info).url_name |
1930 | 1938 | ||
1931 | context, pagesize, orderby = _build_list_helper(request, | 1939 | context, pagesize, orderby = _build_list_helper(request, |
@@ -2000,7 +2008,7 @@ if True: | |||
2000 | build_info = _build_page_range(Paginator(queryset, pagesize), request.GET.get('page', 1)) | 2008 | build_info = _build_page_range(Paginator(queryset, pagesize), request.GET.get('page', 1)) |
2001 | 2009 | ||
2002 | # build view-specific information; this is rendered specifically in the builds page, at the top of the page (i.e. Recent builds) | 2010 | # build view-specific information; this is rendered specifically in the builds page, at the top of the page (i.e. Recent builds) |
2003 | build_mru = Build.objects.order_by("-started_on")[:3] | 2011 | build_mru = _get_latest_builds()[:3] |
2004 | 2012 | ||
2005 | # calculate the exact begining of local today and yesterday, append context | 2013 | # calculate the exact begining of local today and yesterday, append context |
2006 | context_date,today_begin,yesterday_begin = _add_daterange_context(queryset_all, request, {'started_on','completed_on'}) | 2014 | context_date,today_begin,yesterday_begin = _add_daterange_context(queryset_all, request, {'started_on','completed_on'}) |
@@ -3030,6 +3038,10 @@ if True: | |||
3030 | queryset_all = queryset_all.filter(Q(is_default=False) | | 3038 | queryset_all = queryset_all.filter(Q(is_default=False) | |
3031 | q_default_with_builds) | 3039 | q_default_with_builds) |
3032 | 3040 | ||
3041 | # if in BUILD_MODE, exclude everything but the command line builds project | ||
3042 | if not toastermain.settings.BUILD_MODE: | ||
3043 | queryset_all = queryset_all.exclude(is_default=False) | ||
3044 | |||
3033 | # boilerplate code that takes a request for an object type and returns a queryset | 3045 | # boilerplate code that takes a request for an object type and returns a queryset |
3034 | # for that object type. copypasta for all needed table searches | 3046 | # for that object type. copypasta for all needed table searches |
3035 | (filter_string, search_term, ordering_string) = _search_tuple(request, Project) | 3047 | (filter_string, search_term, ordering_string) = _search_tuple(request, Project) |