[Toaster] [PATCH 11/11] toaster: models Exclude the CANCELLED builds from get_number_of_builds
Michael Wood
michael.g.wood at intel.com
Thu Feb 25 10:21:25 PST 2016
Don't count CANCELLED builds when returning the number of builds.
Signed-off-by: Michael Wood <michael.g.wood at intel.com>
---
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 ba0a8a0..f943f18 100644
--- a/bitbake/lib/toaster/orm/models.py
+++ b/bitbake/lib/toaster/orm/models.py
@@ -194,7 +194,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
More information about the toaster
mailing list