diff --git a/core/signals.py b/core/signals.py index a8a3945e..44a9d1a5 100644 --- a/core/signals.py +++ b/core/signals.py @@ -125,12 +125,11 @@ def process_order_changes(instance: Order, created: bool, **kwargs: dict[Any, An if has_file: order_product.status = "FINISHED" - if not order_product.download: - DigitalAssetDownload.objects.create(order_product=order_product) - order_product.order.user.payments_balance.amount -= order_product.buy_price # type: ignore [union-attr, operator] - order_product.order.user.payments_balance.save() # type: ignore [union-attr] - order_product.save() - continue + DigitalAssetDownload.objects.get_or_create(order_product=order_product) + order_product.order.user.payments_balance.amount -= order_product.buy_price # type: ignore [union-attr, operator] + order_product.order.user.payments_balance.save() # type: ignore [union-attr] + order_product.save() + continue order_product.save()