From e3e3cdf01a9b35ffe3fa6dd3e516e5f26be230ee Mon Sep 17 00:00:00 2001 From: Aevann Date: Sat, 20 May 2023 14:17:13 +0300 Subject: [PATCH] fix ppl receiving their badge 1 day late --- files/routes/front.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/routes/front.py b/files/routes/front.py index 95aa8aa5a..3ced93899 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -147,10 +147,10 @@ def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, filter_words=' pins = pins.order_by(Submission.created_utc.desc()).all() posts = pins + posts - if v and time.time() - v.created_utc > 365 * 86400: + if v and (time.time() - v.created_utc) > (365 * 86400 - 1): badge_grant(user=v, badge_id=134) - if v and time.time() - v.created_utc > 365 * 86400 * 2: + if v and (time.time() - v.created_utc) > (365 * 86400 * 2 - 1): badge_grant(user=v, badge_id=237) if ids_only: posts = [x.id for x in posts]