fix(M01): 조합 메모·이름 검사 흠 둘 고침
메모 칸이 글자 아닌 값(수량 등)을 받아도 저장되던 것 · 이름이 글자 아니어도 저장되던 것을 막음(sub2 검증 `ref/_검증_조합.md` 일감 24). 메모는 글자·null만, 이름은 서버 400(글자 아님) + check_combo_form 422(빈 이름·60자 넘음·겹침)로 까닭과 함께 거절. _틀.md 10장 갱신 · 재현 시험 포함 4건 추가(21 통과).
This commit is contained in:
@@ -39,8 +39,11 @@ def _read() -> tuple[dict, str]:
|
||||
|
||||
def _clean(combo: dict, owner: str, key: str | None = None) -> dict:
|
||||
"""서버가 잡는 칸 — 키 · 소유. 화면이 보낸 키·소유는 안 씀 · 열 차례는 `_틀.md` 10장."""
|
||||
if not isinstance(combo, dict) or not str(combo.get("이름") or "").strip():
|
||||
raise store.StoreError(400, "조합 줄에 「이름」 이 없음")
|
||||
if not isinstance(combo, dict):
|
||||
raise store.StoreError(400, "조합 줄이 묶음 아님")
|
||||
name = combo.get("이름")
|
||||
if not isinstance(name, str) or not name.strip():
|
||||
raise store.StoreError(400, "조합 줄에 「이름」 이 없거나 글자 아님")
|
||||
if owner not in OWNERS:
|
||||
raise store.StoreError(400, f"모르는 소유 「{owner}」 — {' · '.join(OWNERS)}")
|
||||
rest = {k: v for k, v in combo.items() if k not in ("키", "원문번호", "소유")}
|
||||
|
||||
Reference in New Issue
Block a user