diff options
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/toaster/orm/models.py | 11 | ||||
-rw-r--r-- | bitbake/lib/toaster/toastergui/templates/basebuildpage.html | 2 |
2 files changed, 4 insertions, 9 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 | """ |
diff --git a/bitbake/lib/toaster/toastergui/templates/basebuildpage.html b/bitbake/lib/toaster/toastergui/templates/basebuildpage.html index 8d7c562640..eb709bbd43 100644 --- a/bitbake/lib/toaster/toastergui/templates/basebuildpage.html +++ b/bitbake/lib/toaster/toastergui/templates/basebuildpage.html | |||
@@ -117,7 +117,7 @@ | |||
117 | {% endwith %} | 117 | {% endwith %} |
118 | 118 | ||
119 | <!-- new custom image from image recipe in this build --> | 119 | <!-- new custom image from image recipe in this build --> |
120 | {% if build.has_image_targets %} | 120 | {% if build.has_image_recipes %} |
121 | <button class="btn btn-default btn-block navbar-btn" data-role="new-custom-image-trigger">New custom image</button> | 121 | <button class="btn btn-default btn-block navbar-btn" data-role="new-custom-image-trigger">New custom image</button> |
122 | {% include 'newcustomimage_modal.html' %} | 122 | {% include 'newcustomimage_modal.html' %} |
123 | <script> | 123 | <script> |