From 5336c2c48758f66f159028dbf1610f78cb43c91c Mon Sep 17 00:00:00 2001 From: andrey Date: Mon, 2 Apr 2018 20:52:24 +0300 Subject: [PATCH 1/2] fix 500 error --- finance/views.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/finance/views.py b/finance/views.py index c550fda..b10c9e3 100644 --- a/finance/views.py +++ b/finance/views.py @@ -19,7 +19,8 @@ from django.utils.html import strip_tags from courses.models import Course from courses.api import CourseParamsApi -from finance.models import Bill, Invoice, InvoiceRebilling +from finance.models import Bill, Invoice, +ebilling from finance.serializers import BillSerializer, InvoiceSerializer from finance.tasks import setup_periodic_billing from lms.global_decorators import transaction_decorator @@ -268,7 +269,7 @@ class YandexPay(APIView): pay = Payment.objects.get(id=pk) try: inv = InvoiceRebilling.objects.get(yandex_pay=pay) - except InvoiceRebilling: + except InvoiceRebilling.DoesNotExist: inv = None r = requests.post('https://money.yandex.ru/eshop.xml', data={ 'shopId': pay.shop_id, @@ -483,4 +484,4 @@ class DemoYandexCheckView(YandexCheckView): class DemoYandexAvisoView(YandexAvisoView): - pass \ No newline at end of file + pass From b9594633766e72e1a93bff1ffc08b262a16cde42 Mon Sep 17 00:00:00 2001 From: andrey Date: Mon, 2 Apr 2018 20:54:20 +0300 Subject: [PATCH 2/2] fix 500 error --- finance/views.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/finance/views.py b/finance/views.py index b10c9e3..02f3c69 100644 --- a/finance/views.py +++ b/finance/views.py @@ -19,8 +19,7 @@ from django.utils.html import strip_tags from courses.models import Course from courses.api import CourseParamsApi -from finance.models import Bill, Invoice, -ebilling +from finance.models import Bill, Invoice, InvoiceRebilling from finance.serializers import BillSerializer, InvoiceSerializer from finance.tasks import setup_periodic_billing from lms.global_decorators import transaction_decorator