summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastergui/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/toaster/toastergui/views.py')
-rwxr-xr-xbitbake/lib/toaster/toastergui/views.py20
1 files changed, 15 insertions, 5 deletions
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py
index 338b8c36f2..b5ff9b1d53 100755
--- a/bitbake/lib/toaster/toastergui/views.py
+++ b/bitbake/lib/toaster/toastergui/views.py
@@ -43,13 +43,22 @@ import json
43# all new sessions should come through the landing page; 43# all new sessions should come through the landing page;
44# determine in which mode we are running in, and redirect appropriately 44# determine in which mode we are running in, and redirect appropriately
45def landing(request): 45def landing(request):
46 if toastermain.settings.MANAGED and Build.objects.count() == 0 and Project.objects.count() > 0: 46 if toastermain.settings.MANAGED:
47 return redirect(reverse('all-projects'), permanent = False) 47 from bldcontrol.models import BuildRequest
48 if BuildRequest.objects.count() == 0 and Project.objects.count() > 0:
49 return redirect(reverse('all-projects'), permanent = False)
48 50
49 if Build.objects.all().count() > 0: 51 if BuildRequest.objects.all().count() > 0:
50 return redirect(reverse('all-builds'), permanent = False) 52 return redirect(reverse('all-builds'), permanent = False)
53 else:
54 if Build.objects.all().count() > 0:
55 return redirect(reverse('all-builds'), permanent = False)
56
57 context = {}
58 if toastermain.settings.MANAGED:
59 context['lvs_nos'] = Layer_Version.objects.all().count()
51 60
52 return render(request, 'landing.html') 61 return render(request, 'landing.html', context)
53 62
54# returns a list for most recent builds; for use in the Project page, xhr_ updates, and other places, as needed 63# returns a list for most recent builds; for use in the Project page, xhr_ updates, and other places, as needed
55def _project_recent_build_list(prj): 64def _project_recent_build_list(prj):
@@ -2035,6 +2044,7 @@ if toastermain.settings.MANAGED:
2035 2044
2036 context = { 2045 context = {
2037 "project" : prj, 2046 "project" : prj,
2047 "lvs_nos" : Layer_Version.objects.all().count(),
2038 "completedbuilds": BuildRequest.objects.filter(project_id = pid).exclude(state__lte = BuildRequest.REQ_INPROGRESS).exclude(state=BuildRequest.REQ_DELETED), 2048 "completedbuilds": BuildRequest.objects.filter(project_id = pid).exclude(state__lte = BuildRequest.REQ_INPROGRESS).exclude(state=BuildRequest.REQ_DELETED),
2039 "prj" : {"name": prj.name, "release": { "id": prj.release.pk, "name": prj.release.name, "desc": prj.release.description}}, 2049 "prj" : {"name": prj.name, "release": { "id": prj.release.pk, "name": prj.release.name, "desc": prj.release.description}},
2040 #"buildrequests" : prj.buildrequest_set.filter(state=BuildRequest.REQ_QUEUED), 2050 #"buildrequests" : prj.buildrequest_set.filter(state=BuildRequest.REQ_QUEUED),