diff --git a/backend/app/api/deps.py b/backend/app/api/deps.py index c2b83c8..b16f247 100644 --- a/backend/app/api/deps.py +++ b/backend/app/api/deps.py @@ -11,7 +11,7 @@ from sqlmodel import Session from app.core import security from app.core.config import settings from app.core.db import engine -from app.models import TokenPayload, User +from app.models.user import TokenPayload, User reusable_oauth2 = OAuth2PasswordBearer( tokenUrl=f"{settings.API_V1_STR}/login/access-token" diff --git a/backend/app/api/routes/private.py b/backend/app/api/routes/private.py index 9f33ef1..58df018 100644 --- a/backend/app/api/routes/private.py +++ b/backend/app/api/routes/private.py @@ -5,7 +5,7 @@ from pydantic import BaseModel from app.api.deps import SessionDep from app.core.security import get_password_hash -from app.models import ( +from app.models.user import ( User, UserPublic, ) diff --git a/backend/app/api/routes/utils.py b/backend/app/api/routes/utils.py index fc09341..404e9b9 100644 --- a/backend/app/api/routes/utils.py +++ b/backend/app/api/routes/utils.py @@ -2,7 +2,7 @@ from fastapi import APIRouter, Depends from pydantic.networks import EmailStr from app.api.deps import get_current_active_superuser -from app.models import Message +from app.models.base import Message from app.utils import generate_test_email, send_email router = APIRouter(prefix="/utils", tags=["utils"]) diff --git a/backend/app/tests/api/routes/test_login.py b/backend/app/tests/api/routes/test_login.py index afe8150..7a51ec1 100644 --- a/backend/app/tests/api/routes/test_login.py +++ b/backend/app/tests/api/routes/test_login.py @@ -68,7 +68,9 @@ def test_recovery_password_user_not_exits( f"{settings.API_V1_STR}/password-recovery/{email}", headers=normal_user_token_headers, ) - assert r.status_code == 404 + assert ( + r.status_code == 404 + ) # TODO: Fix testing and do not leak known emails with 404 def test_reset_password(client: TestClient, db: Session) -> None: @@ -81,7 +83,6 @@ def test_reset_password(client: TestClient, db: Session) -> None: full_name="Test User", password=password, is_active=True, - is_superuser=False, ) user = User.create(session=db, create_obj=user_create) token = generate_password_reset_token(email=email)