Unverified Commit 2011cbd2 authored by Timothy Jaeryang Baek's avatar Timothy Jaeryang Baek Committed by GitHub
Browse files

Merge pull request #3773 from open-webui/dev

fix: db
parents 3661dd16 ebcc5be1
...@@ -159,7 +159,7 @@ class AuthsTable: ...@@ -159,7 +159,7 @@ class AuthsTable:
log.info(f"authenticate_user_by_trusted_header: {email}") log.info(f"authenticate_user_by_trusted_header: {email}")
try: try:
with get_db() as db: 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: if auth:
user = Users.get_user_by_id(auth.id) user = Users.get_user_by_id(auth.id)
return user return user
......
...@@ -100,7 +100,7 @@ class TagTable: ...@@ -100,7 +100,7 @@ class TagTable:
) -> Optional[TagModel]: ) -> Optional[TagModel]:
try: try:
with get_db() as db: 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) return TagModel.model_validate(tag)
except Exception as e: except Exception as e:
return None return None
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment