Fix SyntaxError: user=Depends nach Form-Params (Python positional-after-default)

This commit is contained in:
Dotty Dotter 2026-04-10 14:30:54 +02:00
parent 7159240f49
commit 303b30f6dd

View File

@ -139,12 +139,12 @@ async def index(request: Request):
@limiter.limit("10/minute") @limiter.limit("10/minute")
async def start_analysis( async def start_analysis(
request: Request, request: Request,
user=Depends(require_auth),
background_tasks: BackgroundTasks, background_tasks: BackgroundTasks,
text: Optional[str] = Form(None), text: Optional[str] = Form(None),
file: Optional[UploadFile] = File(None), file: Optional[UploadFile] = File(None),
bundesland: str = Form("NRW"), bundesland: str = Form("NRW"),
model: str = Form("qwen-plus"), model: str = Form("qwen-plus"),
user: dict = Depends(require_auth),
): ):
"""Start analysis job.""" """Start analysis job."""
if not text and not file: if not text and not file:
@ -478,10 +478,10 @@ async def search_landtag(
async def analyze_drucksache( async def analyze_drucksache(
request: Request, request: Request,
background_tasks: BackgroundTasks, background_tasks: BackgroundTasks,
user=Depends(require_auth),
drucksache: str = Form(...), drucksache: str = Form(...),
bundesland: str = Form("NRW"), bundesland: str = Form("NRW"),
model: str = Form("qwen-plus") model: str = Form("qwen-plus"),
user: dict = Depends(require_auth),
): ):
""" """
Download a document from parliament portal and analyze it. Download a document from parliament portal and analyze it.
@ -748,9 +748,9 @@ async def programme_status():
async def index_programme( async def index_programme(
request: Request, request: Request,
background_tasks: BackgroundTasks, background_tasks: BackgroundTasks,
user=Depends(require_auth),
programm_id: str = Form(None), programm_id: str = Form(None),
all_programmes: bool = Form(False), all_programmes: bool = Form(False),
user: dict = Depends(require_auth),
): ):
"""Index programme(s) for semantic search.""" """Index programme(s) for semantic search."""
pdf_dir = static_dir / "referenzen" pdf_dir = static_dir / "referenzen"