fix 1 year badge

pull/98/head
Aevann 2023-01-25 14:36:09 +02:00
parent 3555e23f76
commit 90181024cc
1 changed files with 7 additions and 7 deletions

View File

@ -389,13 +389,13 @@ class User(Base):
if time.time() - self.created_utc > 363 * 86400:
date = time.strftime("%d %b", time.gmtime(self.created_utc))
now = time.strftime("%d %b", time.gmtime())
if date == now:
g.db.flush()
if not self.has_badge(134):
new_badge = Badge(badge_id=134, user_id=self.id)
g.db.add(new_badge)
g.db.flush()
return True
if date == now: return True
if time.time() - self.created_utc > 365 * 86400 and not self.has_badge(134):
new_badge = Badge(badge_id=134, user_id=self.id)
g.db.add(new_badge)
g.db.flush()
return False
@property