summaryrefslogtreecommitdiffstats
path: root/bitbake/lib
diff options
context:
space:
mode:
authorMichael Wood <michael.g.wood@intel.com>2015-11-13 13:48:34 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-11-16 11:55:06 +0000
commit5fa4c736038b09ae545e22e46f414d398b5a177c (patch)
treea2313dee56f3b5b6c2d30d178f8169a409784d8f /bitbake/lib
parentc4032f479ed9c86048f80b327d9fda5fdb255951 (diff)
downloadpoky-5fa4c736038b09ae545e22e46f414d398b5a177c.tar.gz
bitbake: toaster: orm Fix get_number_of_builds to count all apart from IN_PROGRESS
The count of a project's builds should not include those which are currently in progress. (Bitbake rev: a981700701c41c7bbb6a9778e95f691278c5c294) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r--bitbake/lib/toaster/orm/models.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py
index 3832905838..0ac94b9339 100644
--- a/bitbake/lib/toaster/orm/models.py
+++ b/bitbake/lib/toaster/orm/models.py
@@ -130,13 +130,12 @@ class Project(models.Model):
130 try: 130 try:
131 return self.projectvariable_set.get(name="MACHINE").value 131 return self.projectvariable_set.get(name="MACHINE").value
132 except (ProjectVariable.DoesNotExist,IndexError): 132 except (ProjectVariable.DoesNotExist,IndexError):
133 return( "None" ); 133 return None;
134 134
135 def get_number_of_builds(self): 135 def get_number_of_builds(self):
136 try: 136 """Return the number of builds which have ended"""
137 return len(Build.objects.filter( project = self.id )) 137
138 except (Build.DoesNotExist,IndexError): 138 return self.build_set.filter(~Q(outcome=Build.IN_PROGRESS)).count()
139 return( 0 )
140 139
141 def get_last_build_id(self): 140 def get_last_build_id(self):
142 try: 141 try: