Merge pull request #3773 from open-webui/dev

fix: db
This commit is contained in:
Timothy Jaeryang Baek 2024-07-10 13:36:15 -07:00 committed by GitHub
commit 2011cbd210
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -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