From 6e3e05c6e1dda68d1974ab907941526525f770f2 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Tue, 20 Sep 2022 04:55:38 +0200 Subject: [PATCH] tweak last commit --- files/helpers/cron.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/files/helpers/cron.py b/files/helpers/cron.py index a0afa7175..5b22796ea 100644 --- a/files/helpers/cron.py +++ b/files/helpers/cron.py @@ -132,10 +132,17 @@ def give_monthly_marseybux_task_kofi(): month = datetime.datetime.now() + datetime.timedelta(days=5) month = month.strftime('%B') + tx_emails = [x[0] for x in g.db.query(Transaction.email).distinct().all()] + for u in g.db.query(User).filter(User.patron > 0, User.patron_utc == 0).all(): + g.db.add(u) + + if not (u.is_activated and u.email in tx_emails): + u.patron = 0 + continue + procoins = procoins_li[u.patron] u.procoins += procoins - g.db.add(u) send_repeatable_notification(u.id, f"@AutoJanny has given you {procoins} Marseybux for the month of {month}! You can use them to buy awards in the [shop](/shop).") ma = ModAction(