summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastergui/views.py
diff options
context:
space:
mode:
authorMichael Wood <michael.g.wood@intel.com>2015-03-13 14:34:41 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-03-21 00:00:27 +0000
commit3c5e2917604315775eebe7e62a560a853e5b1c58 (patch)
treed9312698dba69508bb67ce2df502c149d0bad195 /bitbake/lib/toaster/toastergui/views.py
parent2f684f1bdc188fde5142ee95989994a7990984c5 (diff)
downloadpoky-3c5e2917604315775eebe7e62a560a853e5b1c58.tar.gz
bitbake: toaster: Add cancel build to latest build section
Add this functionality to the common managed_mrb_section Make sure we are using the correct version of this template in the projects template and remove now redundant code. [YOCTO #7351] (Bitbake rev: 23f1439a5d3e8f4053826794c6502eca20189054) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/toastergui/views.py')
-rwxr-xr-xbitbake/lib/toaster/toastergui/views.py11
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 = {};