Compare commits

...

3 Commits

Author SHA1 Message Date
Barcode Betty c005c68230 fix: move dispose_engine import inside lifespan function
The top-level import of dispose_engine from cartsnitch_api.database
caused ImportError at module scope because dispose_engine was not
available when main.py was loaded. The function is only used inside
the lifespan context manager, so move the import there.

Fixes: ImportError cannot import name 'dispose_engine' from 'cartsnitch_api.database'

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-23 21:28:41 +00:00
Savannah Savings 1805ff93cf Merge pull request 'fix: add UAT/dev domains to cors_origins' (#14) from cs_betty/api:car992-fix into dev
fix: add UAT/dev domains to cors_origins (#14)

Refs: CAR-992
2026-05-23 20:55:39 +00:00
Barcode Betty 0127c16d0b fix: add UAT/dev domains to cors_origins
Add dev.cartsnitch.com and uat.cartsnitch.com to the CORS origins list
to match the infra HTTPRoute domains and fix auth blocking on UAT.

Refs: CAR-992
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-23 20:45:56 +00:00
2 changed files with 7 additions and 2 deletions
+6 -1
View File
@@ -23,7 +23,12 @@ class Settings(BaseSettings):
auth_service_url: str = "http://auth:3001"
cors_origins: list[str] = ["http://localhost:3000", "https://cartsnitch.com"]
cors_origins: list[str] = [
"http://localhost:3000",
"https://cartsnitch.com",
"https://dev.cartsnitch.com",
"https://uat.cartsnitch.com",
]
receiptwitness_url: str = "http://receiptwitness:8001"
stickershock_url: str = "http://stickershock:8002"
+1 -1
View File
@@ -6,7 +6,6 @@ from fastapi import APIRouter, FastAPI
from cartsnitch_api.auth.routes import router as auth_router
from cartsnitch_api.cache import cache_client
from cartsnitch_api.database import dispose_engine
from cartsnitch_api.middleware.cors import add_cors_middleware
from cartsnitch_api.middleware.error_handler import add_error_handlers, add_error_monitor_middleware
from cartsnitch_api.middleware.rate_limit import add_rate_limit_middleware
@@ -26,6 +25,7 @@ from cartsnitch_api.routes.user import router as user_router
@asynccontextmanager
async def lifespan(app: FastAPI):
from cartsnitch_api.database import dispose_engine
await cache_client.initialize()
yield
await cache_client.close()