Skip to content

Commit 5f323ba

Browse files
committed
Vendor is not postgres
1 parent a20397a commit 5f323ba

File tree

1 file changed

+0
-21
lines changed
  • django_mongodb_extensions/debug_toolbar/panels/mql

1 file changed

+0
-21
lines changed

django_mongodb_extensions/debug_toolbar/panels/mql/tracking.py

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,6 @@ def log(self, op, duration, args, kwargs=None):
5858
)
5959

6060
def _decode(self, param):
61-
if PostgresJson and isinstance(param, PostgresJson):
62-
# psycopg3
63-
if hasattr(param, "obj"):
64-
return param.dumps(param.obj)
65-
# psycopg2
66-
if hasattr(param, "adapted"):
67-
return param.dumps(param.adapted)
68-
6961
# If a sequence type, decode each element separately
7062
if isinstance(param, (tuple, list)):
7163
return [self._decode(element) for element in param]
@@ -81,19 +73,6 @@ def _decode(self, param):
8173
except UnicodeDecodeError:
8274
return "(encoded string)"
8375

84-
def _last_executed_query(self, sql, params):
85-
"""Get the last executed query from the connection."""
86-
# Django's psycopg3 backend creates a new cursor in its implementation of the
87-
# .last_executed_query() method. To avoid wrapping that cursor, temporarily set
88-
# the DatabaseWrapper's ._djdt_logger attribute to None. This will cause the
89-
# monkey-patched .cursor() and .chunked_cursor() methods to skip the wrapping
90-
# process during the .last_executed_query() call.
91-
self.db._djdt_logger = None
92-
try:
93-
return self.db.ops.last_executed_query(self.cursor, sql, params)
94-
finally:
95-
self.db._djdt_logger = self.logger
96-
9776
def _record(self, method, sql, params):
9877
alias = self.db.alias
9978
vendor = self.db.vendor

0 commit comments

Comments
 (0)