From d75165e31a9e38053fd9de7f570dc7ec16e22235 Mon Sep 17 00:00:00 2001 From: Daniel Date: Mon, 4 May 2026 12:31:49 +0200 Subject: [PATCH] Arreglar el bug de posiblemente creator y primary_image este en None... --- tienda/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tienda/models.py b/tienda/models.py index 553afb6..f15a28f 100644 --- a/tienda/models.py +++ b/tienda/models.py @@ -111,9 +111,9 @@ class Product(models.Model): "price": self.price, "stock": self.stock, "category": self.category.to_dict(), - "primary_image": self.primary_image.to_dict(), + "primary_image": self.primary_image.to_dict() if self.primary_image else None, "secondary_images": [secondary_image.to_dict() for secondary_image in self.secondary_images.all()], - "creator": self.creator.to_dict() + "creator": self.creator.to_dict() if self.creator else None }