Skip to content

Commit

Permalink
Change the way we get sqlalchemy session (#1940)
Browse files Browse the repository at this point in the history
* changed default fast model to gpt-4o-mini

* Changed the way we get the sqlalchemy session
  • Loading branch information
hagen-danswer authored Jul 25, 2024
1 parent c9fb99d commit a40d2a1
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions backend/danswer/auth/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
from danswer.db.auth import get_user_count
from danswer.db.auth import get_user_db
from danswer.db.engine import get_session
from danswer.db.engine import get_sqlalchemy_engine
from danswer.db.models import AccessToken
from danswer.db.models import User
from danswer.db.users import get_user_by_email
Expand Down Expand Up @@ -101,12 +102,10 @@ def verify_email_is_invited(email: str) -> None:
raise PermissionError("User not on allowed user whitelist")


def verify_email_in_whitelist(
email: str,
db_session: Session = Depends(get_session),
) -> None:
if not get_user_by_email(email, db_session):
verify_email_is_invited(email)
def verify_email_in_whitelist(email: str) -> None:
with Session(get_sqlalchemy_engine()) as db_session:
if not get_user_by_email(email, db_session):
verify_email_is_invited(email)


def verify_email_domain(email: str) -> None:
Expand Down

0 comments on commit a40d2a1

Please sign in to comment.