Repository navigation
[FIX] gift_compassion: keep partner and project on gifts without sponsorship - #2216
Merged
Merged
Conversation
…sorship partner_id, project_id and child_id lost store=True in the 18.0 migration and became plain related fields on sponsorship_id. On a manual Project Gift (no sponsorship) the partner and project were silently dropped on save, and the CreateGift message had no supporter nor RecipientId. Make them stored computed fields filled from the sponsorship when there is one and editable otherwise. Gifts without sponsorship are only blended with pending gifts of the same partner and project. A post-migration refills the columns of gifts created since 18.0 from their sponsorship. Assisted-by: claude-opus-5-5, medium, claude-code
[Medium impact] The PR appears safe to merge; no blocking issues were found. Reviews (2) · Last reviewed commit: "Merge branch '18.0' into fix-project-gif..." · Reviewed by Greptile |
Member
|
Also looks sound 👍 |
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.
Problem
Creating a
sponsorship.giftmanually for a project (Project Gift, e.g. ET0202), without sponsorship: after collecting the payments and setting the partner, saving dropped both the partner and the project.partner_id,project_idandchild_idloststore=Truein the 18.0 migration (a2cc384) and became plainrelatedfields onsponsorship_id. With no sponsorship, the values were written to an empty record and lost. TheCreateGiftmessage to GMC therefore had noSupporter_GlobalIDnorRecipientId.Fix
readonly=False): taken from the sponsorship when there is one, editable otherwise.create()/_search_for_similar_pending_gifts()no longer assumesponsorship_idis in the vals. Gifts without sponsorship are only blended with pending gifts of the same partner and project.18.0.1.0.1refills the columns of gifts whose values differ from their sponsorship (gifts created since 18.0 have NULLs).Tests (local anonymized Swiss DB)
-u gift_compassion: migration ran. The 120 gifts that were out of sync now all match their sponsorship (each one checked against a snapshot taken before). The 35 gifts without sponsorship are unchanged.CreateGiftJSON hasRecipientType: Project Gift,RecipientId: ET0202and the supporter'sSupporter_GlobalID.🤖 Generated with Claude Code