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