fix ppl receiving their badge 1 day late

pull/152/head
Aevann 2023-05-20 14:17:13 +03:00
parent 6a5917f134
commit e3e3cdf01a
1 changed files with 2 additions and 2 deletions

View File

@ -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]