From 383650b5adaa73971b6db78c956697b9461c168e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Magalh=C3=A3es?= Date: Sat, 15 Sep 2018 02:32:14 +0100 Subject: [PATCH] new import validation --- src/budy/models/product.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/budy/models/product.py b/src/budy/models/product.py index 741e25ff..77800fb5 100644 --- a/src/budy/models/product.py +++ b/src/budy/models/product.py @@ -779,6 +779,9 @@ def get_currency_ripe(self, currency = None): def get_image(self, size = None, order = None): for image in self.images: + if not image: continue + if not hasattr(image, "size"): continue + if not hasattr(image, "order"): continue is_size = size == None or image.size == size if not is_size: continue is_order = order == None or image.order == order