Fixes: 1) Correct string argument in hasattr call within download_url method.

This commit is contained in:
Egor Pavlovich Gorbunov 2025-10-03 17:38:18 +03:00
parent 6fe1664d57
commit 58e1390d4d

View file

@ -1784,7 +1784,7 @@ 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]
if hasattr(self, download):
if hasattr(self, "download"):
return self.download.url
else:
return DigitalAssetDownload.objects.create(order_product=self).url