Skip to contentSkip to conversation

toaster: remove custom images from Image Recipes

PATCH New Michael Wood 1 participant 1 message Feb 23, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 toaster: remove custom images from Image Recipes

From: Dave Lerner <[email protected]>

Fix the view of 'Image Recipes' under 'Configuration' to only show image recipes that are not customised since custom images have their own page.

[YOCTO #9111]

---
 lib/toaster/toastergui/tables.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
lib/toaster/toastergui/tables.py +4 -1
index c0ad2b7..528f2ad 100644
@@ -549,7 +549,10 @@ class ImageRecipesTable(RecipesTable):
     def setup_queryset(self, *args, **kwargs):
         super(ImageRecipesTable, self).setup_queryset(*args, **kwargs)
 
-        self.queryset = self.queryset.filter(is_image=True)
+        custom_image_recipes = CustomImageRecipe.objects.filter(
+                project=kwargs['pid'])
+        self.queryset = self.queryset.filter(
+                Q(is_image=True) & ~Q(pk__in=custom_image_recipes))
         self.queryset = self.queryset.order_by(self.default_orderby)
 
 
Signature · 1 line
2.5.0