easier deletion after event

master
Aevann 2024-11-14 21:41:41 +02:00
parent ce09ea8f9c
commit 7b33c03d3d
1 changed files with 2 additions and 2 deletions

View File

@ -1434,7 +1434,7 @@ class User(Base):
or (has_request_context() and request.path in {'/notifications/modmail', '/notifications/messages'}): or (has_request_context() and request.path in {'/notifications/modmail', '/notifications/messages'}):
return self return self
uid = redis_instance.get(f'{self.id}-switched') uid = redis_instance.get(f'switched-{self.id}')
if uid: return g.db.get(User, uid) if uid: return g.db.get(User, uid)
three_days = time.time() - 259200 three_days = time.time() - 259200
@ -1444,7 +1444,7 @@ class User(Base):
not_(User.username.like('deleted~%')), not_(User.username.like('deleted~%')),
).order_by(User.truescore.desc()).first() ).order_by(User.truescore.desc()).first()
uid = uid[0] if uid else self.id uid = uid[0] if uid else self.id
redis_instance.set(f'{self.id}-switched', uid) redis_instance.set(f'switched-{self.id}', uid)
return g.db.get(User, uid) return g.db.get(User, uid)
@property @property