feat(propose): honor project initial_state (§22.4b active landing + unreviewed)

This commit is contained in:
Ben Stull
2026-06-03 23:48:08 -07:00
parent e8ce3cd228
commit fe47eefdd9
2 changed files with 51 additions and 1 deletions
+8 -1
View File
@@ -827,10 +827,16 @@ def make_router(
if idea_clash:
raise HTTPException(409, f"Slug `{slug}` is already reserved by an open proposal")
# §22.4b: the target project's landing state. Through Plan A every
# entry lands in the default project; M3-frontend routing carries a
# non-default target later.
target_project = auth.DEFAULT_PROJECT_ID
landing_state = "active" if projects_mod.project_initial_state(target_project) == "active" else "super-draft"
entry = entry_mod.Entry(
slug=slug,
title=payload.title.strip(),
state="super-draft",
state=landing_state,
id=None,
repo=None,
proposed_by=user.email or user.gitea_login,
@@ -845,6 +851,7 @@ def make_router(
arbiters=[],
tags=[t.strip() for t in payload.tags if t.strip()],
body=payload.pitch.strip() + "\n",
unreviewed=(landing_state == "active"),
)
contents = entry_mod.serialize(entry)
pr_title = f"Propose: {entry.title}"