Repository navigation
Conversation
PUT /tickets/{id} dumped the full Ticket model, so any field the client
omitted was filled with its default and written by the PATCH. The Tickets
page edit form has no assignee input, so every edit from the UI silently
set assigned_user_id to NULL.
update_ticket now PATCHes only the fields present in the request
(model_dump(exclude_unset=True)), and writes status history only when the
request includes a status.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0171zWzmk8ywmS3JeGFiZq3C
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PUT /tickets/{id}usedmodel_dump()on the fullTicketmodel. Any field the client left out was filled with its default and written by the PATCH. The Tickets page edit form has no assignee input, so every ticket edit from the UI setassigned_user_idtoNULL, and the assignee was lost without any error.update_ticketnow PATCHes only the fields that are in the request (model_dump(exclude_unset=True)). It writes aticket_historyrow only when the request includes astatus. Blank id fields are still converted toNULL. Other routes are unchanged because their forms send every field.I checked all open PRs (#17–#77) and searched issues and PRs: none fix this. #76 and #74 touch the same
clean_empty_stringscall inupdate_ticket, and #45, #47, #72 and #77 edit the same function. Small merge conflicts are possible, but none of them change which fields get written.Testing
test_update_ticket_only_patches_fields_sent_by_client(sends the Tickets page form payload and checksassigned_user_idis not in the PATCH) andtest_update_ticket_without_status_skips_history. Both fail without the fix.pytest: 45 passed, with dummySUPABASE_URL/SUPABASE_KEY.ruff check,ruff format --checkandmypy .are clean.Generated by Claude Code