You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I disagree!
Depending on how you have your model set up, you can have the database fulfill the role of lock by raising an integrity error for the duplicate object creation request, which then becomes 406 conflict or 400 error, which can be handled appropriately by clients.
Using get_or_create for a create request would muddy clear semantics.
There exists a race condition in the rest_framework create / update methods.
I think we should use get_or_create there, to prevent this race condition from happening.
The text was updated successfully, but these errors were encountered: