Fixes: 1) Correct string argument in hasattr call within download_url method.
This commit is contained in:
parent
6fe1664d57
commit
58e1390d4d
1 changed files with 1 additions and 1 deletions
|
|
@ -1784,7 +1784,7 @@ class OrderProduct(ExportModelOperationsMixin("order_product"), NiceModel): # t
|
||||||
def download_url(self: Self) -> str:
|
def download_url(self: Self) -> str:
|
||||||
if self.product and self.product.stocks:
|
if self.product and self.product.stocks:
|
||||||
if self.product.is_digital and self.product.stocks.first().digital_asset: # type: ignore [union-attr]
|
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
|
return self.download.url
|
||||||
else:
|
else:
|
||||||
return DigitalAssetDownload.objects.create(order_product=self).url
|
return DigitalAssetDownload.objects.create(order_product=self).url
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue