mirror of
https://github.com/simple-login/app.git
synced 2024-11-13 23:51:13 +01:00
21 lines
492 B
Python
21 lines
492 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().date():
|
|
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()
|