Skip to content

Commit

Permalink
fix: wrong typing
Browse files Browse the repository at this point in the history
  • Loading branch information
lchen-2101 committed Dec 23, 2024
1 parent 00f14a8 commit 80c2fe7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/regtech_user_fi_management/dependencies.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
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
from regtech_api_commons.api.exceptions import RegTechHttpException
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"
Expand All @@ -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)

0 comments on commit 80c2fe7

Please sign in to comment.