From ebcc5be1bfcf41b23c854373068aa7bc0be996d9 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Wed, 10 Jul 2024 13:35:52 -0700 Subject: [PATCH] fix: db --- backend/apps/webui/models/auths.py | 2 +- backend/apps/webui/models/tags.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/apps/webui/models/auths.py b/backend/apps/webui/models/auths.py index a17d92ff1..bcea4a367 100644 --- a/backend/apps/webui/models/auths.py +++ b/backend/apps/webui/models/auths.py @@ -159,7 +159,7 @@ class AuthsTable: log.info(f"authenticate_user_by_trusted_header: {email}") try: with get_db() as db: - auth = db.query(Auth).filter(email=email, active=True).first() + auth = db.query(Auth).filter_by(email=email, active=True).first() if auth: user = Users.get_user_by_id(auth.id) return user diff --git a/backend/apps/webui/models/tags.py b/backend/apps/webui/models/tags.py index bb98d3a38..7285b6fe2 100644 --- a/backend/apps/webui/models/tags.py +++ b/backend/apps/webui/models/tags.py @@ -100,7 +100,7 @@ class TagTable: ) -> Optional[TagModel]: try: with get_db() as db: - tag = db.query(Tag).filter(name=name, user_id=user_id).first() + tag = db.query(Tag).filter_by(name=name, user_id=user_id).first() return TagModel.model_validate(tag) except Exception as e: return None