Improve logger message

This commit is contained in:
PCoder 2019-06-12 07:29:19 +02:00
parent 4147b8f891
commit ecdc0c32fb

View file

@ -109,12 +109,11 @@ def handle_invoice_webhook(request):
send_plain_email_task.delay(email_to_admin_data)
elif event.type == "invoice.payment_failed":
logger.error("Invoice payment failed")
admin_msg_sub = "Invoice payment FAILED for user {} and {}".format(
stripe_customer.user.email,
invoice.lines.data.metadata
)
logger.error(admin_msg_sub)
email_to_admin_data = {
'subject': admin_msg_sub,
'from_email': settings.DCL_SUPPORT_FROM_ADDRESS,