add logic for 2 year badge

pull/139/head
Aevann 2023-03-10 00:40:42 +02:00
parent 3a8cff1e74
commit ef8b7de749
1 changed files with 5 additions and 0 deletions

View File

@ -418,6 +418,11 @@ class User(Base):
g.db.add(new_badge)
g.db.flush()
if time.time() - self.created_utc > 365 * 86400 * 2 and not self.has_badge(236):
new_badge = Badge(badge_id=236, user_id=self.id)
g.db.add(new_badge)
g.db.flush()
return False
@property