fix(B01): 값 변경 없이 참여자만 저장할 때 404 반환 문제 수정

- update_project 가 rowcount 0(변경된 컬럼 없음)을 프로젝트 없음으로 오판하던 자리에 존재 확인 추가
- 참여자 수정권한·시스템 회사 역할 규칙 검증 테스트 추가 (tmp/tests, git 추적 제외)

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-09-06 11:46:11 +09:00
co-authored by Claude Opus 5
parent aed7465a5f
commit 2c03dbee3e
+8 -1
View File
@@ -287,7 +287,14 @@ async def update_project(project_id: str, data: dict[str, Any], actor_id: int) -
),
)
changed = cursor.rowcount > 0
if changed:
if not changed:
# 값이 하나도 안 바뀌면 rowcount 가 0 이다 — 프로젝트가 없는 것과는 다르다
# (참여자만 바꿀 때 「찾을 수 없습니다」로 튕기던 자리, 2026-09-06).
await cursor.execute(
"SELECT 1 FROM projects WHERE id = %s AND deleted_at IS NULL", (project_id,)
)
changed = await cursor.fetchone() is not None
else:
await cursor.execute(
"""INSERT INTO system_audit_logs (user_id, action, resource_type, resource_id)
VALUES (%s, 'PROJECT_UPDATE', 'project', NULL)""",