mirror of
https://git.yoctoproject.org/poky
synced 2026-02-14 20:53:03 +01:00
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>
This commit is contained in:
committed by
Richard Purdie
parent
c9a05be1ff
commit
3b233fca49
@@ -2804,6 +2804,14 @@ if True:
|
||||
|
||||
queryset_all = Project.objects.all()
|
||||
|
||||
# annotate each project with its number of builds
|
||||
queryset_all = queryset_all.annotate(num_builds=Count('build'))
|
||||
|
||||
# exclude the command line builds project if it has no builds
|
||||
q_default_with_builds = Q(is_default=True) & Q(num_builds__gt=0)
|
||||
queryset_all = queryset_all.filter(Q(is_default=False) |
|
||||
q_default_with_builds)
|
||||
|
||||
# boilerplate code that takes a request for an object type and returns a queryset
|
||||
# for that object type. copypasta for all needed table searches
|
||||
(filter_string, search_term, ordering_string) = _search_tuple(request, Project)
|
||||
|
||||
Reference in New Issue
Block a user