fix(balance): Replace deprecated sqlalchemy functions
continuous-integration/woodpecker the build failed Details

This commit is contained in:
Ferdinand Thiessen 2021-12-19 19:01:48 +01:00
parent d9be9430db
commit 22fbb526bb
1 changed files with 2 additions and 2 deletions

View File

@ -40,7 +40,7 @@ class Transaction(db.Model, ModelSerializeMixin):
@sender_id.expression @sender_id.expression
def sender_id(cls): def sender_id(cls):
return db.select([User.userid]).where(cls._sender_id == User.id_).as_scalar() return db.select([User.userid]).where(cls._sender_id == User.id_).scalar_subquery()
@hybrid_property @hybrid_property
def receiver_id(self): def receiver_id(self):
@ -48,7 +48,7 @@ class Transaction(db.Model, ModelSerializeMixin):
@receiver_id.expression @receiver_id.expression
def receiver_id(cls): def receiver_id(cls):
return db.select([User.userid]).where(cls._receiver_id == User.id_).as_scalar() return db.select([User.userid]).where(cls._receiver_id == User.id_).scalar_subquery()
@property @property
def author_id(self): def author_id(self):