summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/orm/models.py
diff options
context:
space:
mode:
authorElliot Smith <elliot.smith@intel.com>2016-07-12 15:54:55 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-07-19 08:56:52 +0100
commit9475a684c4baa45ba7bdc6ac7a122c122ed17ed9 (patch)
treebc8d87a618273e648b703362e3640af8b01e7b36 /bitbake/lib/toaster/orm/models.py
parent2db40e377148c862161125a56bb3b9d5d2ed9a7c (diff)
downloadpoky-9475a684c4baa45ba7bdc6ac7a122c122ed17ed9.tar.gz
bitbake: toaster: the customise image button shouldn't rely on targets
The build dashboard customise image button (for creating a new custom image based on an image recipe used by a build) shouldn't rely on targets: whether a new custom image can be created or not depends on whether any of the recipes used by the build are image recipes. Modify the method used to determine whether a build has customisable images to look at the image recipes used during the build, rather than whether the targets run by the build refer to image recipes. (Bitbake rev: 6648876c91134bda8498b4f8d7ace9147ec0d985) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: bavery <brian.avery@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/orm/models.py')
-rw-r--r--bitbake/lib/toaster/orm/models.py11
1 files changed, 3 insertions, 8 deletions
diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py
index 8e40f0aca2..048399f34d 100644
--- a/bitbake/lib/toaster/orm/models.py
+++ b/bitbake/lib/toaster/orm/models.py
@@ -449,18 +449,13 @@ class Build(models.Model):
449 break 449 break
450 return has_images 450 return has_images
451 451
452 def has_image_targets(self): 452 def has_image_recipes(self):
453 """ 453 """
454 Returns True if a build has any targets which were built from 454 Returns True if a build has any targets which were built from
455 image recipes. 455 image recipes.
456 """ 456 """
457 targets = Target.objects.filter(build_id=self.id) 457 image_recipes = self.get_image_recipes()
458 has_image_targets = False 458 return len(image_recipes) > 0
459 for target in targets:
460 if target.is_image:
461 has_image_targets = True
462 break
463 return has_image_targets
464 459
465 def get_image_file_extensions(self): 460 def get_image_file_extensions(self):
466 """ 461 """