From 5ad28cd9106a85f13ea20cd24eea45b6d0d75146 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 26 Jul 2021 01:35:23 +0200 Subject: [PATCH] fdfd --- drama/routes/admin.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/drama/routes/admin.py b/drama/routes/admin.py index 261a8b1208..1dc6d49cd1 100644 --- a/drama/routes/admin.py +++ b/drama/routes/admin.py @@ -24,11 +24,24 @@ import matplotlib.pyplot as plt from .front import frontlist from drama.__main__ import app, cache -@app.route("/dramacoins", methods=["GET"]) +@app.route("/dramacoins/posts", methods=["GET"]) @admin_level_required(6) -def sex(v): - for p in g.db.query(Submission).options(lazyload('*')).all() + g.db.query(Comment).options(lazyload('*')).all(): +def dp(v): + for p in g.db.query(Submission).options(lazyload('*')).all(): + print(p.id) if p.author: + print(p.author.username) + p.author.dramacoins += p.upvotes + p.downvotes - 1 + g.db.add(p.author) + return "sex" + +@app.route("/dramacoins/comments", methods=["GET"]) +@admin_level_required(6) +def dc(v): + for p in g.db.query(Comment).options(lazyload('*')).all(): + print(p.id) + if p.author: + print(p.author.username) p.author.dramacoins += p.upvotes + p.downvotes - 1 g.db.add(p.author) return "sex"