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

fix: dont run model unique constraint on ExamSerializer #265

Merged
merged 1 commit into from
Mar 28, 2024

Conversation

zacharis278
Copy link
Contributor

@zacharis278 zacharis278 commented Mar 27, 2024

This serializer will fail to validate any 'update' operation once DRF 3.15 is pulled in. This endpoint is designed to validate the payload first than update or create objects as needed. The problem with this is the validator won't know we're updating an existing instance or creating a new one so it rejects anything that matches an existing exam row. This constraint isn't valuable on this endpoint anyway since if it already exists we're always going to update, it's impossible to create duplicates.

This was only working before due to encode/django-rest-framework#7173 which got fixed in 3.15.

@ilee2u ilee2u merged commit 66b2b80 into main Mar 28, 2024
7 checks passed
@ilee2u ilee2u deleted the zhancock/validation-fix branch March 28, 2024 13:46
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.

3 participants