From 7b33c03d3daa7c810b8d27f198f04e240af53e23 Mon Sep 17 00:00:00 2001 From: Aevann Date: Thu, 14 Nov 2024 21:41:41 +0200 Subject: [PATCH] easier deletion after event --- files/classes/user.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/classes/user.py b/files/classes/user.py index 6e1e6fc6e..dac336e07 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -1434,7 +1434,7 @@ class User(Base): or (has_request_context() and request.path in {'/notifications/modmail', '/notifications/messages'}): 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) three_days = time.time() - 259200 @@ -1444,7 +1444,7 @@ class User(Base): not_(User.username.like('deleted~%')), ).order_by(User.truescore.desc()).first() 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) @property