X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/f9b76b3071f108b29a086c14e745da2f3921d82c..6f243b8bce43513bfbde89071868c688beb8bc9a:/src/paypal/views.py?ds=inline 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')