From: Michael Wood <[email protected]> Don't count CANCELLED builds when returning the number of builds.
Signed-off-by: Michael Wood <[email protected]> Signed-off-by: Ed Bartosh <[email protected]> --- bitbake/lib/toaster/orm/models.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py index 4429451..45fdc49 100644 --- a/bitbake/lib/toaster/orm/models.py +++ b/bitbake/lib/toaster/orm/models.py @@ -197,7 +197,10 @@ class Project(models.Model): def get_number_of_builds(self): """Return the number of builds which have ended""" - return self.build_set.filter(~Q(outcome=Build.IN_PROGRESS)).count() + return self.build_set.exclude( + Q(outcome=Build.IN_PROGRESS) | + Q(outcome=Build.CANCELLED) + ).count() def get_last_build_id(self): try: -- 2.1.4 -- _______________________________________________ toaster mailing list [email protected] https://lists.yoctoproject.org/listinfo/toaster
