mirror of
https://github.com/simple-login/app.git
synced 2024-11-10 17:35:27 +08:00
263f68ecec
- create subscription table - rename plan_expiration -> trial_expiration - remove user.plan, user.promo_codes
21 lines
485 B
Python
21 lines
485 B
Python
import arrow
|
|
|
|
from app.log import LOG
|
|
from app.models import Subscription
|
|
from server import create_app
|
|
|
|
|
|
def late_payment():
|
|
"""check for late payment
|
|
"""
|
|
for sub in Subscription.query.all():
|
|
if (not sub.cancelled) and sub.next_bill_date < arrow.now():
|
|
LOG.error(f"user {sub.user.email} has late payment. {sub}")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
LOG.d("Start running cronjob")
|
|
app = create_app()
|
|
|
|
with app.app_context():
|
|
late_payment()
|