fnp
/
wolnelektury.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
594ca8a
)
fix for multiple agreements
author
Jan Szejko
<janek37@gmail.com>
Sun, 2 Sep 2018 12:05:16 +0000
(14:05 +0200)
committer
Jan Szejko
<janek37@gmail.com>
Sun, 2 Sep 2018 12:05:16 +0000
(14:05 +0200)
src/paypal/rest.py
patch
|
blob
|
history
diff --git
a/src/paypal/rest.py
b/src/paypal/rest.py
index
9d9f45a
..
3590c6f
100644
(file)
--- 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):