Features: 1) Deduct buy_price from user's payment balance upon order product creation.
Fixes: None; Extra: None;
This commit is contained in:
parent
83ce862a83
commit
81247bde52
1 changed files with 2 additions and 0 deletions
|
|
@ -103,6 +103,8 @@ def process_order_changes(instance, created, **_kwargs):
|
||||||
download = DigitalAssetDownload.objects.create(order_product=order_product)
|
download = DigitalAssetDownload.objects.create(order_product=order_product)
|
||||||
order_product.download = download
|
order_product.download = download
|
||||||
order_product.save()
|
order_product.save()
|
||||||
|
order_product.order.user.payments_balance.amount -= order_product.buy_price
|
||||||
|
order_product.order.user.payments_balance.save()
|
||||||
continue
|
continue
|
||||||
try:
|
try:
|
||||||
logger.debug("Trying to buy: %s", str(order_product.uuid))
|
logger.debug("Trying to buy: %s", str(order_product.uuid))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue