fix 1 year badge
parent
3555e23f76
commit
90181024cc
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue