fix 500 error

remotes/origin/revert-6d879fe8
andrey 8 years ago
parent 5f1e130200
commit 5336c2c487
  1. 7
      finance/views.py

@ -19,7 +19,8 @@ from django.utils.html import strip_tags
from courses.models import Course from courses.models import Course
from courses.api import CourseParamsApi 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.serializers import BillSerializer, InvoiceSerializer
from finance.tasks import setup_periodic_billing from finance.tasks import setup_periodic_billing
from lms.global_decorators import transaction_decorator from lms.global_decorators import transaction_decorator
@ -268,7 +269,7 @@ class YandexPay(APIView):
pay = Payment.objects.get(id=pk) pay = Payment.objects.get(id=pk)
try: try:
inv = InvoiceRebilling.objects.get(yandex_pay=pay) inv = InvoiceRebilling.objects.get(yandex_pay=pay)
except InvoiceRebilling: except InvoiceRebilling.DoesNotExist:
inv = None inv = None
r = requests.post('https://money.yandex.ru/eshop.xml', data={ r = requests.post('https://money.yandex.ru/eshop.xml', data={
'shopId': pay.shop_id, 'shopId': pay.shop_id,
@ -483,4 +484,4 @@ class DemoYandexCheckView(YandexCheckView):
class DemoYandexAvisoView(YandexAvisoView): class DemoYandexAvisoView(YandexAvisoView):
pass pass

Loading…
Cancel
Save