From b6ca73a0c57fb18ef2d3e74442b0f34a350ad089 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 2 Jul 2022 11:30:17 +0200 Subject: [PATCH] testing --- files/helpers/cron.py | 5 ++--- files/routes/admin.py | 5 ++++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/files/helpers/cron.py b/files/helpers/cron.py index 7c46fdc8e..2249fccc9 100644 --- a/files/helpers/cron.py +++ b/files/helpers/cron.py @@ -8,7 +8,7 @@ import files.helpers.stats as stats import files.helpers.awards as awards import files.routes.static as route_static from files.routes.subs import sub_inactive_purge_task -from files.routes.admin import give_monthly_marseybux_task, migrate_polls +from files.routes.admin import give_monthly_marseybux_task from sys import stdout @@ -33,8 +33,7 @@ def cron(every_5m, every_1h, every_1d, every_1mo): sub_inactive_purge_task() if every_1mo: - #give_monthly_marseybux_task() - migrate_polls() + give_monthly_marseybux_task() g.db.commit() g.db.close() diff --git a/files/routes/admin.py b/files/routes/admin.py index 4b7b154f2..dc16ed22e 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -50,8 +50,10 @@ def give_monthly_marseybux_task(): return True -def migrate_polls(): +@app.post('/migrate_polls') +@admin_level_required(3) +def migrate_polls(v): polls = g.db.query(Comment).filter_by(author_id=6176, parent_comment_id=None, parent_submission=77232).all() for c in polls: print(c.id, flush=True) @@ -74,6 +76,7 @@ def migrate_polls(): g.db.delete(c) g.db.commit() + return 'test' @app.post('/kippy') @admin_level_required(3)