Update more .query usages

This commit is contained in:
Matthias
2023-03-16 06:44:53 +01:00
parent 8865af9104
commit ae361e1d5d
4 changed files with 12 additions and 11 deletions

View File

@@ -954,12 +954,12 @@ class RPC:
def _rpc_delete_lock(self, lockid: Optional[int] = None,
pair: Optional[str] = None) -> Dict[str, Any]:
""" Delete specific lock(s) """
locks = []
locks: Sequence[PairLock] = []
if pair:
locks = PairLocks.get_pair_locks(pair)
if lockid:
locks = PairLock.session.scalar(select(PairLock).filter(PairLock.id == lockid)).all()
locks = PairLock.session.scalars(select(PairLock).filter(PairLock.id == lockid)).all()
for lock in locks:
lock.active = False