Fallback to vm_id from order if its not set in metadata

This commit is contained in:
PCoder 2019-04-16 00:02:44 +02:00
commit 22accdd0d0

View file

@ -88,6 +88,9 @@ def handle_invoice_webhook(request):
mbli = HostingBillLineItem.objects.filter(monthly_hosting_bill=mhb).first()
vm_id = mbli.get_vm_id()
if vm_id is None:
vm_id = mhb.order.vm_id
# Send an email to admin
admin_msg_sub = "Invoice payment success for user {} and VM {}".format(
stripe_customer.user.email,