Skip to content

Commit 7d4c530

Browse files
authored
Fixes #1239
This is just PoC. I wouldn't know how to test this properly.
1 parent ebd4ae3 commit 7d4c530

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

debug_toolbar/panels/sql/tracking.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ def cursor(*args, **kwargs):
5555
)
5656

5757
def chunked_cursor(*args, **kwargs):
58+
# prevent double wrapping
59+
# solves https://github.com/jazzband/django-debug-toolbar/issues/1239
60+
if hasattr(connection._djdt_cursor, "__wrapped__"):
61+
return connection._djdt_cursor(*args, **kwargs)
5862
return state.Wrapper(
5963
connection._djdt_chunked_cursor(*args, **kwargs), connection, panel
6064
)

0 commit comments

Comments
 (0)