Skip to content

Commit eee98e5

Browse files
refactor: restore main to make incremental refactors
1 parent 7a1b6df commit eee98e5

2 files changed

Lines changed: 13 additions & 17 deletions

File tree

app/main.py

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,22 @@
22
from typing import Any
33
from urllib.parse import urlparse
44

5-
import structlog
65
from asgi_correlation_id import CorrelationIdMiddleware
76
from asgi_correlation_id.context import correlation_id
87
from celery import Celery
9-
from fastapi import FastAPI
10-
from fastapi import Request
11-
from fastapi import Response
12-
from fastapi import status
8+
from fastapi import FastAPI, Request, Response, status
139
from fastapi.encoders import jsonable_encoder
1410
from fastapi.exceptions import RequestValidationError
1511
from fastapi.responses import JSONResponse
1612
from starlette.middleware.cors import CORSMiddleware
13+
import structlog
1714
from uvicorn.protocols.utils import get_path_with_query_string
1815

19-
from app.celery.celery_settings import get_celery_settings
2016

2117
# NOTE: Unconventional import order is needed to control boot up flow
2218
# region Configuration
2319
from app.core.config import settings
20+
from app.celery.celery_settings import get_celery_settings
2421

2522
celery_settings = get_celery_settings()
2623

@@ -144,21 +141,20 @@ async def validation_exception_handler(
144141
)
145142

146143

147-
# from app.two_factor_authentication.api.router import (
148-
# api_router as two_factor_authentication_router,
149-
# )
150-
# from app.auth.api.routers import api_router as auth_router
151-
from app.common.api.routers import api_router as common_router
152-
153144
# region Routers
154145
# NOTE: its important to import routers last as this action
155146
# triggers import of the use case layer all the way down
156147
# to the model definitions.
157148
from app.users.api.routers import api_router as users_router
149+
from app.two_factor_authentication.api.router import (
150+
api_router as two_factor_authentication_router,
151+
)
152+
from app.auth.api.routers import api_router as auth_router
153+
from app.common.api.routers import api_router as common_router
158154

159155
app.include_router(users_router, prefix=settings.API_V1_STR)
160-
# app.include_router(auth_router, prefix=settings.API_V1_STR)
156+
app.include_router(auth_router, prefix=settings.API_V1_STR)
161157
app.include_router(common_router, prefix=settings.API_V1_STR)
162-
# app.include_router(
163-
# two_factor_authentication_router, prefix=settings.API_V1_STR
164-
# )
158+
app.include_router(
159+
two_factor_authentication_router, prefix=settings.API_V1_STR
160+
)

app/two_factor_authentication/api/endpoints.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from fastapi import APIRouter, HTTPException, status
33
from slowapi import Limiter
44

5-
from app.common.api.dependencies.get_session import SessionDependency
5+
from app.common.api.dependencies.session_dependency import SessionDependency
66
from app.common.exceptions.model_not_created_exception import (
77
ModelNotCreatedException,
88
)

0 commit comments

Comments
 (0)