exclude dwhite

master
Aevann 2024-04-01 05:18:37 +02:00
parent 57b7c1ae8d
commit 8575eb6d8d
1 changed files with 10 additions and 7 deletions

View File

@ -1310,14 +1310,14 @@ class User(Base):
@property
@lazy
def user_name(self):
random.seed(self.id)
uid = random.choice(USER_IDS)
if self.id != 2249:
random.seed(self.id)
uid = random.choice(USER_IDS)
to_load = [User.username]
if SITE_NAME == 'rDrama':
to_load.append(User.earlylife)
self = g.db.query(User).options(load_only(*to_load)).filter_by(id=uid).one()
to_load = [User.username]
if SITE_NAME == 'rDrama':
to_load.append(User.earlylife)
self = g.db.query(User).options(load_only(*to_load)).filter_by(id=uid).one()
if self.earlylife:
expiry = int(self.earlylife - time.time())
if expiry > 86400:
@ -1331,6 +1331,9 @@ class User(Base):
@property
@lazy
def switched(self):
if self.id == 2249:
return self
random.seed(self.id)
uid = random.choice(USER_IDS)
return g.db.query(User).filter_by(id=uid).one()