We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents ebd4ae3 + 7e2c161 commit 6ec6bfeCopy full SHA for 6ec6bfe
debug_toolbar/panels/sql/tracking.py
@@ -55,9 +55,12 @@ def cursor(*args, **kwargs):
55
)
56
57
def chunked_cursor(*args, **kwargs):
58
- return state.Wrapper(
59
- connection._djdt_chunked_cursor(*args, **kwargs), connection, panel
60
- )
+ # prevent double wrapping
+ # solves https://github.com/jazzband/django-debug-toolbar/issues/1239
+ cursor = connection._djdt_chunked_cursor(*args, **kwargs)
61
+ if not isinstance(cursor, state.Wrapper):
62
+ return state.Wrapper(cursor, connection, panel)
63
+ return cursor
64
65
connection.cursor = cursor
66
connection.chunked_cursor = chunked_cursor
0 commit comments