forked from MarseyWorld/MarseyWorld
easier deletion after event
parent
ce09ea8f9c
commit
7b33c03d3d
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue