[1.7.x] Simplified handling of use_debug_cursor.
Turned it from a tri-valued boolean into a regular boolean.
Backport of 127218b9
from master.
This commit is contained in:
parent
11f0bdc007
commit
e5879811e6
|
@ -39,7 +39,7 @@ class BaseDatabaseWrapper(object):
|
||||||
self.queries = []
|
self.queries = []
|
||||||
self.settings_dict = settings_dict
|
self.settings_dict = settings_dict
|
||||||
self.alias = alias
|
self.alias = alias
|
||||||
self.use_debug_cursor = None
|
self.use_debug_cursor = False
|
||||||
|
|
||||||
# Savepoint management related attributes
|
# Savepoint management related attributes
|
||||||
self.savepoint_state = 0
|
self.savepoint_state = 0
|
||||||
|
@ -157,8 +157,7 @@ class BaseDatabaseWrapper(object):
|
||||||
Creates a cursor, opening a connection if necessary.
|
Creates a cursor, opening a connection if necessary.
|
||||||
"""
|
"""
|
||||||
self.validate_thread_sharing()
|
self.validate_thread_sharing()
|
||||||
if (self.use_debug_cursor or
|
if self.use_debug_cursor or settings.DEBUG:
|
||||||
(self.use_debug_cursor is None and settings.DEBUG)):
|
|
||||||
cursor = self.make_debug_cursor(self._cursor())
|
cursor = self.make_debug_cursor(self._cursor())
|
||||||
else:
|
else:
|
||||||
cursor = utils.CursorWrapper(self._cursor(), self)
|
cursor = utils.CursorWrapper(self._cursor(), self)
|
||||||
|
|
Loading…
Reference in New Issue