Skip to content

Commit 2946aba

Browse files
ImTotemclaude
andcommitted
fix(lint): avoid unpacking nullable find_by_id in service layers
Use row.update() instead of re-querying after update to avoid pyright errors on dict | None unpacking. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 16fd4f1 commit 2946aba

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/bcsd_api/apply/service.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,8 @@ def confirm_payment(
116116
if row["status"] != "납부_대기":
117117
raise BadRequest("application is not in payment pending status")
118118
app_repo.update_fields(app_id, {"status": "납부_완료", "updated_at": _now()})
119-
return ApplicationResponse(**app_repo.find_by_id(app_id))
119+
row["status"] = "납부_완료"
120+
return ApplicationResponse(**row)
120121

121122

122123
def approve(
@@ -139,7 +140,8 @@ def approve(
139140
"approved_by": admin_id, "updated_at": now,
140141
})
141142
member_repo.update_status(row["member_id"], new_status)
142-
result.append(ApplicationResponse(**app_repo.find_by_id(app_id)))
143+
row.update({"status": "승인", "approved_at": now, "approved_by": admin_id})
144+
result.append(ApplicationResponse(**row))
143145
return result
144146

145147

src/bcsd_api/recruit/service.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,12 @@ def create_period(
2929
def update_period(
3030
repo: PgRecruitRepository, period_id: str, req: UpdatePeriodRequest,
3131
) -> PeriodResponse:
32-
_get_or_raise(repo, period_id)
32+
row = _get_or_raise(repo, period_id)
3333
updates = req.model_dump(exclude_none=True)
3434
updates["updated_at"] = _now()
3535
repo.update_fields(period_id, updates)
36-
return PeriodResponse(**repo.find_by_id(period_id))
36+
row.update(updates)
37+
return PeriodResponse(**row)
3738

3839

3940
def list_periods(repo: PgRecruitRepository) -> list[PeriodResponse]:

0 commit comments

Comments
 (0)