Skip to content

Conversation

@arthanson
Copy link
Collaborator

Fixes: #7503

Makes Device ViewSet to object validation and creation serial, instead of validating all at once then creating all at once - to catch conditions like overlapping rack locations.

@arthanson arthanson changed the title DRAFT: 7503 do device validate-create in serial 7503 do device validate-create in serial Apr 11, 2023
@arthanson arthanson marked this pull request as ready for review April 11, 2023 19:42
@jeremystretch jeremystretch force-pushed the 7503-bulk-create-rack-space branch from 819db7e to b5f9fe6 Compare May 26, 2023 18:15
return serializers.DeviceWithConfigContextSerializer

@transaction.atomic
def create(self, request, *args, **kwargs):
Copy link
Member

Choose a reason for hiding this comment

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

IMO we should move this to a mixin class in case we need it for other views in the future.

@jeremystretch
Copy link
Member

I've moved the create() method into a separate mixin class to enable its future re-use, but kept it applied only to the device viewset for now. @arthanson can you give this a quick sanity check please to make sure I didn't miss anything?

@arthanson
Copy link
Collaborator Author

@jeremystretch looks good.

@jeremystretch jeremystretch merged commit 8b051ea into develop May 31, 2023
@jeremystretch jeremystretch deleted the 7503-bulk-create-rack-space branch May 31, 2023 13:06
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 1, 2023
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.

API Bulk-Create of Devices does not check Rack-Space in its own context

3 participants