- active = check_agreement(resource.id)
- BillingAgreementModel.objects.create(
- agreement_id=resource.id, user=request.user, plan=plan, active=active, token=token)
+ active = check_agreement(resource.id) or False
+ BillingAgreement.objects.create(
+ agreement_id=resource.id, schedule=schedule, plan=plan, active=active, token=token)
+ if active:
+ schedule.set_payed()