# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
-from datetime import datetime, timedelta
+from datetime import date, datetime, timedelta
from decimal import Decimal
import paypalrestsdk
import pytz
return a.state == 'Active'
-def user_is_subscribed(user):
- agreements = BillingAgreement.objects.filter(user=user)
- return any(agreement.check_agreement() for agreement in agreements)
-
-
def execute_agreement(token):
return paypalrestsdk.BillingAgreement.execute(token)