fix(api): /api/projects/:id returns 404 (not 500) for unknown id incl. superusers

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Ben Stull
2026-06-03 23:39:27 -07:00
parent c386b05960
commit 07e003e5fc
2 changed files with 16 additions and 2 deletions
+2 -2
View File
@@ -10,7 +10,7 @@ from __future__ import annotations
import json
from typing import Any
from fastapi import APIRouter, Request
from fastapi import APIRouter, HTTPException, Request
from . import auth, db
@@ -53,7 +53,7 @@ def make_router() -> APIRouter:
(project_id,),
).fetchone()
if row is None:
auth.require_project_readable(viewer, project_id) # raises 404
raise HTTPException(status_code=404, detail="Not found")
cfg = json.loads(row["config_json"] or "{}")
dep = db.conn().execute("SELECT tagline FROM deployment WHERE id = 1").fetchone()
return {