Merge branch 'frost' into upgrade-to-sqlalchemy2

This commit is contained in:
justcool393 2023-08-09 00:30:15 -07:00 committed by GitHub
commit 3e66d8a7bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 71 additions and 202 deletions

View file

@ -23,9 +23,7 @@ from files.classes.userblock import UserBlock
from files.classes.visstate import StateMod
from files.helpers.assetcache import assetcache_path
from files.helpers.config.const import *
from files.helpers.config.environment import (CARD_VIEW,
CLUB_TRUESCORE_MINIMUM,
DEFAULT_COLOR,
from files.helpers.config.environment import (CARD_VIEW, DEFAULT_COLOR,
DEFAULT_TIME_FILTER, SITE_FULL,
SITE_ID)
from files.helpers.security import *
@ -96,7 +94,6 @@ class User(CreatedBase):
is_banned = mapped_column(Integer, default=0, nullable=False)
unban_utc = mapped_column(Integer, default=0, nullable=False)
ban_reason = deferred(mapped_column(String))
club_allowed = mapped_column(Boolean)
login_nonce = mapped_column(Integer, default=0, nullable=False)
reserved = deferred(mapped_column(String))
coins = mapped_column(Integer, default=0, nullable=False)
@ -219,11 +216,6 @@ class User(CreatedBase):
def is_blocking(self, target):
return g.db.query(UserBlock).filter_by(user_id=self.id, target_id=target.id).one_or_none()
@property
@lazy
def paid_dues(self):
return not self.shadowbanned and not (self.is_banned and not self.unban_utc) and (self.admin_level or self.club_allowed or (self.club_allowed != False and self.truescore > CLUB_TRUESCORE_MINIMUM))
@lazy
def any_block_exists(self, other):
return g.db.query(UserBlock).filter(