mirror of
https://github.com/django/django.git
synced 2025-09-26 20:19:16 +00:00
Deprecated transaction.is_managed().
It's synchronized with the autocommit flag.
This commit is contained in:
parent
ba5138b1c0
commit
3bdc7a6a70
7 changed files with 23 additions and 30 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue