X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/10dc1a5e84d23582a58ead2551ddf54a66b94496..a18466c5b58ffbcca36e9834fd713b10265ead29:/src/paypal/views.py?ds=sidebyside diff --git a/src/paypal/views.py b/src/paypal/views.py index c78a19af3..01d3a5aab 100644 --- a/src/paypal/views.py +++ b/src/paypal/views.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # @@ -17,7 +16,7 @@ from paypal.models import BillingAgreement, BillingPlan def paypal_form(request, app=False): if request.POST: - if not request.user.is_authenticated(): + if not request.user.is_authenticated: return HttpResponseForbidden() form = PaypalSubscriptionForm(data=request.POST) if form.is_valid(): @@ -25,7 +24,7 @@ def paypal_form(request, app=False): try: approval_url = agreement_approval_url(amount, app=app) except PaypalError as e: - return render(request, 'paypal/error_page.html', {'error': e.message}) + return render(request, 'paypal/error_page.html', {'error': str(e)}) return HttpResponseRedirect(approval_url) else: form = PaypalSubscriptionForm()