From 7e3f9e502ae17263bdc1c1e4e87a4fb4e8dfe332 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Wed, 27 Oct 2021 22:38:10 +0200 Subject: [PATCH] dffg --- files/routes/admin.py | 12 ++++++++++++ files/routes/comments.py | 8 ++++++++ files/routes/posts.py | 4 ++++ 3 files changed, 24 insertions(+) diff --git a/files/routes/admin.py b/files/routes/admin.py index 527782525..5d4de7a5f 100755 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -20,6 +20,18 @@ from files.helpers.discord import add_role SITE_NAME = environ.get("SITE_NAME", "").strip() + +@app.get("/justice") +@admin_level_required(6) +def justice(v): + for id in [261,1832,1833]: + u = g.db.query(User).options(lazyload('*')).filter_by(id = id).first() + u.comment_count = g.db.query(Comment).options(lazyload('*')).filter_by(author_id = id).count() + g.db.add(u) + g.db.commit() + return "sex" + + @app.get("/truescore") @admin_level_required(6) def truescore(v): diff --git a/files/routes/comments.py b/files/routes/comments.py index b06bba907..71a8b0b6b 100755 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -414,6 +414,10 @@ def api_comment(v): ) g.db.add(c2) + + longpostbot = g.db.query(User).options(lazyload('*')).filter_by(id = LONGPOSTBOT_ACCOUNT).first().comment_count += 1 + g.db.add(longpostbot) + g.db.flush() @@ -496,6 +500,10 @@ def api_comment(v): ) g.db.add(c4) + + zozbot = g.db.query(User).options(lazyload('*')).filter_by(id = ZOZBOT_ACCOUNT).first().comment_count += 3 + g.db.add(zozbot) + g.db.flush() diff --git a/files/routes/posts.py b/files/routes/posts.py index d801813eb..a9aaafc07 100755 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -903,6 +903,10 @@ def submit_post(v): ) g.db.add(c) + + snappy = g.db.query(User).options(lazyload('*')).filter_by(id = SNAPPY_ACCOUNT).first().comment_count += 1 + g.db.add(snappy) + g.db.flush()