Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add unique_together on completed work model, migration #457

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pxwxnvermx
Copy link
Contributor

@pxwxnvermx pxwxnvermx commented Dec 16, 2024

The CompletedWork model is missing a unique together option that is causing a race condition in get_or_create in the form processor when multiple forms come in quick succession for the same payment unit leading to the creation of multiple completed work instances with same entity_id and payment_unit_id. This race condition only comes up in the Payment Unit configuration with multiple deliver units needed for completion.

This PR adds the unique together constraint on the model for the entity_id and payment_unit fields.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant