From 22fbb526bb2f2bf5912dbd31dc8f1029b1732c9b Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Sun, 19 Dec 2021 19:01:48 +0100 Subject: [PATCH] fix(balance): Replace deprecated sqlalchemy functions --- flaschengeist/plugins/balance/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flaschengeist/plugins/balance/models.py b/flaschengeist/plugins/balance/models.py index 23bb32c..1ba206b 100644 --- a/flaschengeist/plugins/balance/models.py +++ b/flaschengeist/plugins/balance/models.py @@ -40,7 +40,7 @@ class Transaction(db.Model, ModelSerializeMixin): @sender_id.expression 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 def receiver_id(self): @@ -48,7 +48,7 @@ class Transaction(db.Model, ModelSerializeMixin): @receiver_id.expression 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 def author_id(self):