diff --git a/core/models.py b/core/models.py index 281d484f..8b889b6a 100644 --- a/core/models.py +++ b/core/models.py @@ -601,6 +601,10 @@ class Product(ExportModelOperationsMixin("product"), NiceModel): # type: ignore def personal_orders_only(self) -> bool: return not (self.quantity > 0 and self.price > 0.0) + @personal_orders_only.setter + def personal_orders_only(self, value): + self.__dict__["personal_orders_only"] = value + class Attribute(ExportModelOperationsMixin("attribute"), NiceModel): # type: ignore [misc, django-manager-missing] __doc__ = _( @@ -1782,7 +1786,7 @@ class OrderProduct(ExportModelOperationsMixin("order_product"), NiceModel): # t if self.product.is_digital and self.product.stocks.first().digital_asset: # type: ignore [union-attr] try: return self.download.url - except self.download.RelatedObjectDoesNotExist: + except DigitalAssetDownload.RelatedObjectDoesNotExist: return DigitalAssetDownload.objects.create(order_product=self).url return ""