[T2747] FIX: moved state update to after payment configuration#2086
[T2747] FIX: moved state update to after payment configuration#2086
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request resolves a critical timing issue where communication jobs were being triggered before essential payment configuration data was fully written to the database. By reordering the contract state update and introducing explicit database flush operations, the change ensures that all necessary payment information is persistently stored prior to activating the contract and initiating any dependent communication processes, thereby preventing potential data inconsistencies and ensuring reliable communication. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request refactors the contract_active method to ensure payment mode data is flushed to the database before activating the contract and triggering an auto-communication job. A review comment suggests refining the flush() calls to be more specific to the modified recordsets, rather than flushing the entire model, to prevent potential unintended side effects.
- FIX: changing state triggers the creation of the communication job, but the payment information/pdf is not yet in the db at the time. This should solve that issue. Testing is still needed!
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
e88cbb1 to
d24b7b6
Compare
* [T2747] FIX: moved state update to after payment configuration - FIX: changing state triggers the creation of the communication job, but the payment information/pdf is not yet in the db at the time. This should solve that issue. Testing is still needed! * Update sponsorship_compassion/models/contracts.py Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --------- Co-authored-by: Daniel Gergely <dgergely@compassion.ch> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
See also CompassionCH/compassion-switzerland#1747