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

Fixes #15995: Permit nullable fields referenced by unique constraints to be omitted from REST API requests #16008

Merged
merged 1 commit into from
May 7, 2024

Conversation

jeremystretch
Copy link
Member

Fixes: #15995

  • Set a default value on each of the relevant fields in API serializers
  • Modify tests to omit these fields in some object representations

@jeremystretch jeremystretch requested a review from arthanson May 7, 2024 18:05
Copy link
Collaborator

@arthanson arthanson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add a test case to catch some of these?

netbox/dcim/api/serializers_/devices.py Show resolved Hide resolved
@jeremystretch
Copy link
Member Author

I've modified existing tests to intentionally omit the affected fields in certain test data. This triggers the exception without the fix in place.

@jeremystretch jeremystretch merged commit 4d40699 into develop May 7, 2024
6 checks passed
@jeremystretch jeremystretch deleted the 15995-fix-unique-constraints-null-fields branch May 7, 2024 19:33
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

'group' required on create API call in tenant
2 participants