diff --git a/src/regtech_user_fi_management/dependencies.py b/src/regtech_user_fi_management/dependencies.py index 7d9045a..d693642 100644 --- a/src/regtech_user_fi_management/dependencies.py +++ b/src/regtech_user_fi_management/dependencies.py @@ -1,7 +1,7 @@ from http import HTTPStatus from typing import Annotated from fastapi import Depends, Request -from sqlalchemy.ext.asyncio import AsyncSession +from sqlalchemy.orm import Session from regtech_user_fi_management.entities.engine.engine import get_session import regtech_user_fi_management.entities.repos.institutions_repo as repo @@ -9,7 +9,7 @@ from regtech_api_commons.api.dependencies import get_email_domain -def check_domain(request: Request, session: Annotated[AsyncSession, Depends(get_session)]) -> None: +def check_domain(request: Request, session: Annotated[Session, Depends(get_session)]) -> None: if not request.user.is_authenticated: raise RegTechHttpException( status_code=HTTPStatus.FORBIDDEN, name="Request Forbidden", detail="unauthenticated user" @@ -20,5 +20,5 @@ def check_domain(request: Request, session: Annotated[AsyncSession, Depends(get_ ) -def email_domain_denied(session: AsyncSession, email: str) -> bool: +def email_domain_denied(session: Session, email: str) -> bool: return not repo.is_domain_allowed(session, email)