Changes between Version 1 and Version 2 of Ticket #30690, comment 1
- Timestamp:
- Aug 8, 2019, 4:28:09 PM (5 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #30690, comment 1
v1 v2 3 3 [https://github.com/django/django/blob/5b57798513066bb6d5ea54225d0bd030a089c501/django/db/models/query.py#L545-L546 There's a comment in the method definition about it] and following the `git blame` trace leads to [https://github.com/django/django/commit/4e9a74b81df1c7aaea2f90a3a4911920e134b275 this commit]. 4 4 5 > If in a single transaction, the master deletes a record and then get_or_creates a similar record, under the new behavior the get_or_create would find the record in the slave db and fail to re-create it, leaving the record nonexistent, which violates the contract of get_or_create that the record should always exist afterwards. We need to do everything against the master here in order to ensure correctness. 6 5 7 Closing as duplicate of #16865.