mirror of
https://github.com/django/django.git
synced 2025-10-29 08:36:09 +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:
@@ -484,9 +484,7 @@ 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)
|
||||
obj.save(using=self.db)
|
||||
return obj, False
|
||||
|
||||
def _create_object_from_params(self, lookup, params):
|
||||
|
||||
Reference in New Issue
Block a user