mirror of
https://github.com/django/django.git
synced 2025-10-30 00:56:09 +00:00
Deprecated transaction.is_managed().
It's synchronized with the autocommit flag.
This commit is contained in:
@@ -442,7 +442,7 @@ class QuerySet(object):
|
||||
self._for_write = True
|
||||
connection = connections[self.db]
|
||||
fields = self.model._meta.local_fields
|
||||
if not transaction.is_managed(using=self.db):
|
||||
if transaction.get_autocommit(using=self.db):
|
||||
transaction.enter_transaction_management(using=self.db, forced=True)
|
||||
forced_managed = True
|
||||
else:
|
||||
@@ -579,7 +579,7 @@ class QuerySet(object):
|
||||
self._for_write = True
|
||||
query = self.query.clone(sql.UpdateQuery)
|
||||
query.add_update_values(kwargs)
|
||||
if not transaction.is_managed(using=self.db):
|
||||
if transaction.get_autocommit(using=self.db):
|
||||
transaction.enter_transaction_management(using=self.db, forced=True)
|
||||
forced_managed = True
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user