diff --git a/core/models.py b/core/models.py index 8b889b6a..465f9868 100644 --- a/core/models.py +++ b/core/models.py @@ -1784,9 +1784,9 @@ class OrderProduct(ExportModelOperationsMixin("order_product"), NiceModel): # t def download_url(self: Self) -> str: if self.product and self.product.stocks: if self.product.is_digital and self.product.stocks.first().digital_asset: # type: ignore [union-attr] - try: + if self.download: return self.download.url - except DigitalAssetDownload.RelatedObjectDoesNotExist: + else: return DigitalAssetDownload.objects.create(order_product=self).url return ""