X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/d679452e8cede72656beb1e14b48a1b3e82e79c0..481c75133987a510db34b0950b6861962aa2aaab:/src/paypal/rest.py diff --git a/src/paypal/rest.py b/src/paypal/rest.py index 9d9f45ab9..3590c6f1d 100644 --- a/src/paypal/rest.py +++ b/src/paypal/rest.py @@ -115,11 +115,8 @@ def check_agreement(agreement_id): def user_is_subscribed(user): - try: - agreement = BillingAgreementModel.objects.get(user=user) - except BillingAgreementModel.DoesNotExist: - return False - return agreement.check_agreement() + agreements = BillingAgreementModel.objects.filter(user=user) + return any(agreement.check_agreement() for agreement in agreements) def execute_agreement(token):