Don't count CANCELLED builds when returning the number of builds.
Signed-off-by: Michael Wood <[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 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
--
_______________________________________________
toaster mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/toaster