forked from rDrama/rDrama
fds
parent
de176280c8
commit
b08d374b4b
|
@ -188,15 +188,16 @@ class User(Base):
|
||||||
@property
|
@property
|
||||||
@lazy
|
@lazy
|
||||||
def is_cakeday(self):
|
def is_cakeday(self):
|
||||||
|
if time.time() - self.created_utc > 365 * 86400:
|
||||||
|
if not self.has_badge(134):
|
||||||
|
new_badge = Badge(badge_id=134, user_id=self.id)
|
||||||
|
g.db.add(new_badge)
|
||||||
|
g.db.commit()
|
||||||
|
|
||||||
if time.time() - self.created_utc > 363 * 86400:
|
if time.time() - self.created_utc > 363 * 86400:
|
||||||
date = time.strftime("%d %b", time.gmtime(self.created_utc))
|
date = time.strftime("%d %b", time.gmtime(self.created_utc))
|
||||||
now = time.strftime("%d %b", time.gmtime())
|
now = time.strftime("%d %b", time.gmtime())
|
||||||
if date == now:
|
if date == now: return True
|
||||||
if not self.has_badge(134):
|
|
||||||
new_badge = Badge(badge_id=134, user_id=self.id)
|
|
||||||
g.db.add(new_badge)
|
|
||||||
g.db.commit()
|
|
||||||
return True
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
Loading…
Reference in New Issue