summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorEd Bartosh <eduard.bartosh@intel.com>2015-12-09 14:18:44 +0200
committerTim Graham <timograham@gmail.com>2015-12-14 19:41:11 -0500
commit423b3afce431fd0a1d683bca9b2b80a1c4e3c8ca (patch)
treeadef37d273518c170151df6cae1fbdf5a762b4f9 /django
parent5146e2cf984a83c2eb9d8102ea73ee0792a9528b (diff)
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().
Diffstat (limited to 'django')
-rw-r--r--django/db/models/query.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/django/db/models/query.py b/django/db/models/query.py
index 006feb6427..e8d9006b48 100644
--- a/django/db/models/query.py
+++ b/django/db/models/query.py
@@ -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):