From 469ce39415d8c15028f3252b5ea430ac7fb1e91b Mon Sep 17 00:00:00 2001 From: Aevann Date: Sat, 13 May 2023 05:05:24 +0300 Subject: [PATCH] fix another 500 error for loggedout-cels --- 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 671113f57..95aa8aa5a 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 time.time() - v.created_utc > 365 * 86400: + if v and time.time() - v.created_utc > 365 * 86400: badge_grant(user=v, badge_id=134) - if time.time() - v.created_utc > 365 * 86400 * 2: + if v and time.time() - v.created_utc > 365 * 86400 * 2: badge_grant(user=v, badge_id=237) if ids_only: posts = [x.id for x in posts]