From a0c074adada397576348406d5859d207b999ec1e Mon Sep 17 00:00:00 2001 From: Keith Edmunds Date: Mon, 22 Aug 2022 17:46:04 +0100 Subject: [PATCH] Checked all queries are SQLAlchemy V2 format --- app/models.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/models.py b/app/models.py index 359151e..863ddf1 100644 --- a/app/models.py +++ b/app/models.py @@ -560,9 +560,8 @@ class Tracks(Base): else created new track and return it """ - try: - track = session.query(cls).filter(cls.path == path).one() - except NoResultFound: + track = cls.get_by_path(session, path) + if not track: track = Tracks(session, path) return track