Skip to content

Commit

Permalink
Fix duplicate users from slack / web (#2530)
Browse files Browse the repository at this point in the history
  • Loading branch information
Weves authored Sep 20, 2024
1 parent 05f6f6d commit 33f5559
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion backend/danswer/db/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from uuid import UUID

from fastapi_users.password import PasswordHelper
from sqlalchemy import func
from sqlalchemy import select
from sqlalchemy.orm import Session

Expand Down Expand Up @@ -34,7 +35,11 @@ def get_users_by_emails(


def get_user_by_email(email: str, db_session: Session) -> User | None:
user = db_session.query(User).filter(User.email == email).first() # type: ignore
user = (
db_session.query(User)
.filter(func.lower(User.email) == func.lower(email))
.first()
)

return user

Expand Down

0 comments on commit 33f5559

Please sign in to comment.