summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastergui/views.py
diff options
context:
space:
mode:
authorElliot Smith <elliot.smith@intel.com>2015-09-02 17:25:10 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-09-03 16:52:49 +0100
commit3b233fca49b4fe3db6e883b2ca7f5a2ee741c4ac (patch)
treeee1763c88f37ac5dc43a20a491d3294dc96db0c3 /bitbake/lib/toaster/toastergui/views.py
parentc9a05be1ffdabb454ee04a905bc6de6f7e3fcc47 (diff)
downloadpoky-3b233fca49b4fe3db6e883b2ca7f5a2ee741c4ac.tar.gz
bitbake: toaster: Exclude default project unless it has builds
Don't include the default "command line builds" project in the projects view unless it has builds associated with it. [YOCTO #7932] (Bitbake rev: b37318057ccbfb3889d28fd593cc1602febf1ae9) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: brian avery <avery.brian@gmail.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.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py
index 6c73eb4c50..4e8f69e801 100755
--- a/bitbake/lib/toaster/toastergui/views.py
+++ b/bitbake/lib/toaster/toastergui/views.py
@@ -2804,6 +2804,14 @@ if True:
2804 2804
2805 queryset_all = Project.objects.all() 2805 queryset_all = Project.objects.all()
2806 2806
2807 # annotate each project with its number of builds
2808 queryset_all = queryset_all.annotate(num_builds=Count('build'))
2809
2810 # exclude the command line builds project if it has no builds
2811 q_default_with_builds = Q(is_default=True) & Q(num_builds__gt=0)
2812 queryset_all = queryset_all.filter(Q(is_default=False) |
2813 q_default_with_builds)
2814
2807 # boilerplate code that takes a request for an object type and returns a queryset 2815 # boilerplate code that takes a request for an object type and returns a queryset
2808 # for that object type. copypasta for all needed table searches 2816 # for that object type. copypasta for all needed table searches
2809 (filter_string, search_term, ordering_string) = _search_tuple(request, Project) 2817 (filter_string, search_term, ordering_string) = _search_tuple(request, Project)