fix: scope transactional locks to primary records

This commit is contained in:
hailin
2026-07-27 20:31:35 +08:00
parent 6a4239e7bb
commit 8296f3c96f
6 changed files with 21 additions and 13 deletions

View File

@@ -257,7 +257,7 @@ def sync_ticket_intake_failure_work_item(
actor=None,
) -> WorkItem | None:
draft = (
TicketDraft.objects.select_for_update()
TicketDraft.objects.select_for_update(of=("self",))
.select_related("created_by", "latest_agent_run")
.get(id=draft.id)
)