forked from rDrama/rDrama
im retarded
parent
c8079e1d9d
commit
9c5015d662
|
@ -414,22 +414,25 @@ class User(Base):
|
||||||
@property
|
@property
|
||||||
@lazy
|
@lazy
|
||||||
def is_cakeday(self):
|
def is_cakeday(self):
|
||||||
|
return_value = False
|
||||||
|
|
||||||
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: return True
|
if date == now:
|
||||||
|
return_value = True
|
||||||
|
|
||||||
if time.time() - self.created_utc > 363 * 86400 and not self.has_badge(134):
|
if time.time() - self.created_utc > 365 * 86400 and not self.has_badge(134):
|
||||||
new_badge = Badge(badge_id=134, user_id=self.id)
|
new_badge = Badge(badge_id=134, user_id=self.id)
|
||||||
g.db.add(new_badge)
|
g.db.add(new_badge)
|
||||||
g.db.flush()
|
g.db.flush()
|
||||||
|
|
||||||
if time.time() - self.created_utc > 363 * 86400 * 2 and not self.has_badge(237):
|
if time.time() - self.created_utc > 365 * 86400 * 2 and not self.has_badge(237):
|
||||||
new_badge = Badge(badge_id=237, user_id=self.id)
|
new_badge = Badge(badge_id=237, user_id=self.id)
|
||||||
g.db.add(new_badge)
|
g.db.add(new_badge)
|
||||||
g.db.flush()
|
g.db.flush()
|
||||||
|
|
||||||
return False
|
return return_value
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@lazy
|
@lazy
|
||||||
|
|
Loading…
Reference in New Issue