POL-126: Fix critical backend bugs — Championship model/DB mismatch, broken imports
- Restore judges/categories TEXT columns to Championship model (were in DB but missing from model) - Remove phantom columns not in DB: org_id, subtitle, venue, accent_color - Remove broken relationships to unmigrated tables (Organization, Discipline, Style, Fee, Rule, Judge) - Remove broken instagram_service import from lifespan (file doesn't exist) - Add http://localhost:3000 to default CORS origins (web frontend) Model files for unmigrated tables kept on disk for future migration. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
from contextlib import asynccontextmanager
|
||||
|
||||
from fastapi import FastAPI
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
|
||||
@@ -7,19 +5,7 @@ from app.config import settings
|
||||
from app.routers import auth, championships, registrations, participant_lists, users
|
||||
|
||||
|
||||
@asynccontextmanager
|
||||
async def lifespan(app: FastAPI):
|
||||
# Start Instagram sync scheduler if configured
|
||||
if settings.INSTAGRAM_USER_ID and settings.INSTAGRAM_ACCESS_TOKEN:
|
||||
from app.services.instagram_service import start_scheduler
|
||||
scheduler = start_scheduler()
|
||||
yield
|
||||
scheduler.shutdown()
|
||||
else:
|
||||
yield
|
||||
|
||||
|
||||
app = FastAPI(title="Pole Dance Championships API", version="1.0.0", lifespan=lifespan)
|
||||
app = FastAPI(title="Pole Dance Championships API", version="1.0.0")
|
||||
|
||||
app.add_middleware(
|
||||
CORSMiddleware,
|
||||
|
||||
Reference in New Issue
Block a user