Skip to content

Commit 72b009c

Browse files
committed
Add a comment explaining why we pass through arguments to cursor()
1 parent 6d3ef0f commit 72b009c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

debug_toolbar/panels/sql/tracking.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ def wrap_cursor(connection, panel):
3939
connection._djdt_cursor = connection.cursor
4040

4141
def cursor(*args, **kwargs):
42+
# Per the DB API cursor() does not accept any arguments. There's
43+
# some code in the wild which does not follow that convention,
44+
# so we pass on the arguments even though it's not clean.
45+
# See:
46+
# https://github.com/jazzband/django-debug-toolbar/pull/615
47+
# https://github.com/jazzband/django-debug-toolbar/pull/896
4248
return state.Wrapper(connection._djdt_cursor(*args, **kwargs), connection, panel)
4349

4450
connection.cursor = cursor

0 commit comments

Comments
 (0)