Skip to content

Commit a25a9a7

Browse files
pre-commit-ci[bot]tim-schilling
authored andcommitted
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 517ae7d commit a25a9a7

File tree

3 files changed

+7
-10
lines changed

3 files changed

+7
-10
lines changed

debug_toolbar/panels/sql/tracking.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ def _decode(self, param):
130130
CONVERT_TYPES = (datetime.datetime, datetime.date, datetime.time)
131131
return force_str(param, strings_only=not isinstance(param, CONVERT_TYPES))
132132

133-
134133
def _last_executed_query(self, sql, params):
135134
"""Get the last executed query from the connection."""
136135
# Django's psycopg3 backend creates a new cursor in its implementation of the

debug_toolbar/sanitize.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33

44
def force_str(s, *args, **kwargs):
5-
'''
5+
"""
66
Forces values to strings.
77
Will return "Django Debug Toolbar was unable to parse value." when there's a decoding error.
8-
'''
8+
"""
99
try:
1010
return force_string(s, *args, **kwargs)
1111
except DjangoUnicodeDecodeError:

tests/test_sanitize.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,12 @@ class ForceStrTestCase(unittest.TestCase):
77
def test_success_convert(self):
88
input = 0
99

10-
self.assertEqual(
11-
force_str(input),
12-
"0"
13-
)
10+
self.assertEqual(force_str(input), "0")
1411

1512
def test_failed_convert(self):
16-
input = bytes.fromhex("a3f2b8c14e972d5a8fb3c7291a64e0859c472bf63d18a0945e73b2c84f917ae2")
13+
input = bytes.fromhex(
14+
"a3f2b8c14e972d5a8fb3c7291a64e0859c472bf63d18a0945e73b2c84f917ae2"
15+
)
1716
self.assertEqual(
18-
force_str(input),
19-
"Django Debug Toolbar was unable to parse value."
17+
force_str(input), "Django Debug Toolbar was unable to parse value."
2018
)

0 commit comments

Comments
 (0)