mirror of
https://github.com/django/django.git
synced 2025-09-27 12:39:17 +00:00
Fixed #25939 -- Removed redundant transaction in QuerySet.update_or_create().
There is no need to wrap the save() call in transaction.atomic() as it's already done down the call stack in Model.save_base().
This commit is contained in:
parent
5146e2cf98
commit
423b3afce4
2 changed files with 5 additions and 3 deletions
|
@ -484,8 +484,6 @@ class QuerySet(object):
|
|||
return obj, created
|
||||
for k, v in six.iteritems(defaults):
|
||||
setattr(obj, k, v)
|
||||
|
||||
with transaction.atomic(using=self.db, savepoint=False):
|
||||
obj.save(using=self.db)
|
||||
return obj, False
|
||||
|
||||
|
|
|
@ -363,6 +363,10 @@ Miscellaneous
|
|||
:class:`~django.http.HttpResponse` are now closed immediately instead of when
|
||||
the WSGI server calls ``close()`` on the response.
|
||||
|
||||
* A redundant ``transaction.atomic()`` call in ``QuerySet.update_or_create()``
|
||||
is removed. This may affect query counts tested by
|
||||
``TransactionTestCase.assertNumQueries()``.
|
||||
|
||||
.. _deprecated-features-1.10:
|
||||
|
||||
Features deprecated in 1.10
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue