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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user