Make printer optional on job creation — assigned when job starts
Migration 0005 makes print_jobs.printer_id nullable. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -141,7 +141,7 @@ def jobs_page(request: Request, q: str = "", db: Session = Depends(get_db)):
|
||||
|
||||
@router.post("/jobs")
|
||||
async def create_job(
|
||||
printer_id: int = Form(...),
|
||||
printer_id: str = Form(""),
|
||||
customer: str = Form(""),
|
||||
filament_id: str = Form(""),
|
||||
notes: str = Form(""),
|
||||
@@ -160,7 +160,7 @@ async def create_job(
|
||||
job_uuid=str(_uuid.uuid4()),
|
||||
name=Path(filename).stem if filename else (customer.strip() or "Unnamed"),
|
||||
file_name=filename,
|
||||
printer_id=printer_id,
|
||||
printer_id=int(printer_id) if printer_id else None,
|
||||
filament_id=int(filament_id) if filament_id else None,
|
||||
customer=customer.strip() or None,
|
||||
notes=notes.strip() or None,
|
||||
|
||||
Reference in New Issue
Block a user