X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/f9b76b3071f108b29a086c14e745da2f3921d82c..08cbe099b8b62c2f48d2ff9865716c7d52ec22d2:/src/paypal/views.py diff --git a/src/paypal/views.py b/src/paypal/views.py index 15a7cf68a..e46be8ce6 100644 --- a/src/paypal/views.py +++ b/src/paypal/views.py @@ -42,13 +42,13 @@ def paypal_return(request, app=False): if resource.id: amount = int(Decimal(resource.plan.payment_definitions[0].amount['value'])) plan = BillingPlan.objects.get(amount=amount) - active = check_agreement(resource.id) + active = check_agreement(resource.id) or False BillingAgreement.objects.create( agreement_id=resource.id, user=request.user, plan=plan, active=active, token=token) else: resource = None if app: - if getattr(resource, 'error'): + if getattr(resource, 'error', None): return HttpResponseAppRedirect('wolnelekturyapp://paypal_error') else: return HttpResponseAppRedirect('wolnelekturyapp://paypal_return')