From 7b648de549e79419bdf0a5ac0ea97f8af7f9f4fd Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Fri, 30 Jul 2021 10:37:21 +0200 Subject: [PATCH] dffd --- drama/helpers/get.py | 8 +++----- drama/routes/comments.py | 2 +- drama/routes/posts.py | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/drama/helpers/get.py b/drama/helpers/get.py index 14d841da20..e8cfdfb87f 100644 --- a/drama/helpers/get.py +++ b/drama/helpers/get.py @@ -44,15 +44,13 @@ def get_user(username, v=None, graceful=False): return user -def get_account(id, v=None, graceful=False): +def get_account(id, v=None): user = g.db.query(User).filter(User.id == id).first() if not user: - if not graceful: - abort(404) - else: - return None + user = g.db.query(User).filter(User.id == int(id, 36)).first() + if not user: abort(404) if v: block = g.db.query(UserBlock).filter( diff --git a/drama/routes/comments.py b/drama/routes/comments.py index 7325c56dbf..7bf680af5b 100644 --- a/drama/routes/comments.py +++ b/drama/routes/comments.py @@ -333,7 +333,7 @@ def api_comment(v): for alt in v.alts: if not alt.is_suspended: - alt.ban(reason="Spamming.") + alt.ban(reason="Spamming.". days=1) for comment in similar_comments: comment.is_banned = True diff --git a/drama/routes/posts.py b/drama/routes/posts.py index 699e87d104..96006b93b1 100644 --- a/drama/routes/posts.py +++ b/drama/routes/posts.py @@ -742,7 +742,7 @@ def submit_post(v): for alt in v.alts: if not alt.is_suspended: - alt.ban(reason="Spamming.") + alt.ban(reason="Spamming.", days=1) for post in similar_posts + similar_urls: post.is_banned = True