diff --git a/finance/views.py b/finance/views.py index c550fda..02f3c69 100644 --- a/finance/views.py +++ b/finance/views.py @@ -268,7 +268,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 +483,4 @@ class DemoYandexCheckView(YandexCheckView): class DemoYandexAvisoView(YandexAvisoView): - pass \ No newline at end of file + pass