Fix digital product detection in crypto payment status views

- Replace non-existent download_instructions attribute with proper is_physical check
- Assume digital by default and only mark as non-digital if any product is physical
- Fixes AttributeError during crypto payment finalization for both XMR and DOGE
This commit is contained in:
Russell Ballestrini 2025-09-28 17:22:39 -04:00
parent 7885ed5d76
commit 62e098a131

View file

@ -760,11 +760,11 @@ def crypto_xmr_status(request):
)
elif current_status == "confirmed":
# Check if it's a digital product by looking at line items
has_digital = False
has_digital = True
if crypto_payment.invoice:
for line_item in crypto_payment.invoice.line_items:
if line_item.product and line_item.product.download_instructions:
has_digital = True
if line_item.product and line_item.product.is_physical:
has_digital = False
break
if has_digital:
@ -856,11 +856,11 @@ def crypto_doge_status(request):
)
elif current_status == "confirmed":
# Check if it's a digital product by looking at line items
has_digital = False
has_digital = True
if crypto_payment.invoice:
for line_item in crypto_payment.invoice.line_items:
if line_item.product and line_item.product.download_instructions:
has_digital = True
if line_item.product and line_item.product.is_physical:
has_digital = False
break
if has_digital: