diff options
Diffstat (limited to 'bitbake/lib/toaster/toastergui/views.py')
-rwxr-xr-x | bitbake/lib/toaster/toastergui/views.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py index 661023e523..26c876080d 100755 --- a/bitbake/lib/toaster/toastergui/views.py +++ b/bitbake/lib/toaster/toastergui/views.py | |||
@@ -1871,8 +1871,7 @@ if toastermain.settings.MANAGED: | |||
1871 | 1871 | ||
1872 | # build view-specific information; this is rendered specifically in the builds page, at the top of the page (i.e. Recent builds) | 1872 | # build view-specific information; this is rendered specifically in the builds page, at the top of the page (i.e. Recent builds) |
1873 | # most recent build is like projects' most recent builds, but across all projects | 1873 | # most recent build is like projects' most recent builds, but across all projects |
1874 | build_mru = BuildRequest.objects.all() | 1874 | build_mru = _managed_get_latest_builds() |
1875 | build_mru = list(build_mru.filter(Q(state__lt=BuildRequest.REQ_COMPLETED) or Q(state=BuildRequest.REQ_DELETED)).order_by("-pk")) + list(build_mru.filter(state__in=[BuildRequest.REQ_COMPLETED, BuildRequest.REQ_FAILED]).order_by("-pk")[:3]) | ||
1876 | 1875 | ||
1877 | fstypes_map = {}; | 1876 | fstypes_map = {}; |
1878 | for build_request in build_info: | 1877 | for build_request in build_info: |
@@ -3130,6 +3129,12 @@ if toastermain.settings.MANAGED: | |||
3130 | } | 3129 | } |
3131 | return render(request, "unavailable_artifact.html", context) | 3130 | return render(request, "unavailable_artifact.html", context) |
3132 | 3131 | ||
3132 | # This returns the mru object that is needed for the | ||
3133 | # managed_mrb_section.html template | ||
3134 | def _managed_get_latest_builds(): | ||
3135 | build_mru = BuildRequest.objects.all() | ||
3136 | build_mru = list(build_mru.filter(Q(state__lt=BuildRequest.REQ_COMPLETED) or Q(state=BuildRequest.REQ_DELETED)).order_by("-pk")) + list(build_mru.filter(state__in=[BuildRequest.REQ_COMPLETED, BuildRequest.REQ_FAILED]).order_by("-pk")[:3]) | ||
3137 | return build_mru | ||
3133 | 3138 | ||
3134 | 3139 | ||
3135 | def projects(request): | 3140 | def projects(request): |
@@ -3153,7 +3158,7 @@ if toastermain.settings.MANAGED: | |||
3153 | project_info = _build_page_range(Paginator(queryset, pagesize), request.GET.get('page', 1)) | 3158 | project_info = _build_page_range(Paginator(queryset, pagesize), request.GET.get('page', 1)) |
3154 | 3159 | ||
3155 | # build view-specific information; this is rendered specifically in the builds page, at the top of the page (i.e. Recent builds) | 3160 | # build view-specific information; this is rendered specifically in the builds page, at the top of the page (i.e. Recent builds) |
3156 | build_mru = Build.objects.order_by("-started_on")[:3] | 3161 | build_mru = _managed_get_latest_builds() |
3157 | 3162 | ||
3158 | # translate the project's build target strings | 3163 | # translate the project's build target strings |
3159 | fstypes_map = {}; | 3164 | fstypes_map = {}; |