From 4f12d7d9e9dde8370336a6cc1309b06a0d8d2a15 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Fri, 17 Dec 2021 05:50:55 +0200 Subject: [PATCH] fdssfd --- files/routes/admin.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/files/routes/admin.py b/files/routes/admin.py index 98e587838..bb4a1268b 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -58,12 +58,18 @@ def revert_actions(v, username): cutoff = int(time.time()) - 86400 posts = [x[0] for x in g.db.query(ModAction.target_submission_id).filter(ModAction.user_id == user.id, ModAction.created_utc > cutoff, ModAction.kind == 'ban_post').all()] + posts = g.db.query(Submission).filter_by(id.in_(posts)).all() + comments = [x[0] for x in g.db.query(ModAction.target_comment_id).filter(ModAction.user_id == user.id, ModAction.created_utc > cutoff, ModAction.kind == 'ban_comment').all()] + comments = g.db.query(Comment).filter_by(id.in_(comments)).all() + for item in posts + comments: item.is_banned = False g.db.add(item) users = (x[0] for x in g.db.query(ModAction.target_user_id).filter(ModAction.user_id == user.id, ModAction.created_utc > cutoff, ModAction.kind.in_(('shadowban', 'ban_user'))).all()) + users = g.db.query(User).filter_by(id.in_(users)).all() + for user in users: user.shadowbanned = None user.is_banned = 0