From c1149e2c004c5310b70aac37c57c08b888731f30 Mon Sep 17 00:00:00 2001 From: Andrey Date: Mon, 2 Apr 2018 08:31:19 +0300 Subject: [PATCH] finance email --- finance/views.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/finance/views.py b/finance/views.py index b89b98c..788e47a 100644 --- a/finance/views.py +++ b/finance/views.py @@ -447,8 +447,11 @@ class YandexAvisoView(APIView): msg.attach_alternative(html_content, "text/html") msg.send() - if pay.invoice.rebilling_on: + try: + InvoiceRebilling.objects.get(yandex_pay=pay) setup_periodic_billing(pay.order_number) + except InvoiceRebilling.DoesNotExist: + pass return HttpResponse(xml_res, content_type='application/xml')