From 42bbeb2ddcc1877e2649425d2c5b7293e5222e98 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Thu, 21 Oct 2021 01:16:03 +0200 Subject: [PATCH] dsf --- files/routes/votes.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/files/routes/votes.py b/files/routes/votes.py index 10c113b3a..fcf6f4161 100755 --- a/files/routes/votes.py +++ b/files/routes/votes.py @@ -97,6 +97,10 @@ def api_vote_post(post_id, new, v): ) g.db.add(vote) + if post.stickied and post.stickied.startswith("t:") and int(time.time()) > int(post.stickied[2:]): + post.stickied = None + g.db.add(post) + try: g.db.flush() post.upvotes = g.db.query(Vote.id).options(lazyload('*')).filter_by(submission_id=post.id, vote_type=1).count() @@ -104,10 +108,6 @@ def api_vote_post(post_id, new, v): g.db.add(post) g.db.commit() except: g.db.rollback() - - if post.stickied and post.stickied.startswith("t:") and int(time.time()) > int(post.stickied[2:]): - post.stickied = None - g.db.add(post) return "", 204 @app.post("/vote/comment//")