add code for namelock badge

pull/150/head
Aevann 2023-05-16 03:20:55 +03:00
parent 14b56a3460
commit 91987cd080
3 changed files with 3 additions and 1 deletions

View File

@ -68,6 +68,7 @@ class Badge(Base):
if self.badge_id == 168: return self.user.bite
if self.badge_id == 169: return self.user.earlylife
if self.badge_id == 171: return self.user.rainbow
if self.badge_id == 281: return self.user.namechanged
return None

View File

@ -224,7 +224,7 @@ def _award_timers_task():
User.chudded_by: None,
})
_process_timer(User.flairchanged, [96], "Your temporary flair-lock has expired. You can now change your flair!")
_process_timer(User.namechanged, [], "Your temporary name-lock has expired. You're now back to your old username!", {
_process_timer(User.namechanged, [281], "Your temporary name-lock has expired. You're now back to your old username!", {
User.username: User.prelock_username,
User.prelock_username: None,
})

View File

@ -363,6 +363,7 @@ def award_thing(v, thing_type, id):
author.prelock_username = author.username
author.username = new_name
author.namechanged = int(time.time()) + 86400
badge_grant(user=author, badge_id=281)
elif kind == "pause":
badge_grant(badge_id=68, user=author)
elif kind == "unpausable":