Skip to content

Commit 57541b7

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent b9e9922 commit 57541b7

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

debug_toolbar/panels/settings.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
from django.utils.encoding import force_str
1+
from django.utils.encoding import DjangoUnicodeDecodeError, force_str
22
from django.utils.translation import gettext_lazy as _
33
from django.views.debug import get_default_exception_reporter_filter
4-
from django.utils.encoding import DjangoUnicodeDecodeError
54

65
from debug_toolbar.panels import Panel
76

@@ -25,12 +24,11 @@ def title(self):
2524
)
2625

2726
def generate_stats(self, request, response):
28-
2927
def catch_force_errors(force_function, value):
3028
try:
3129
return force_function(value)
3230
except DjangoUnicodeDecodeError:
33-
return 'Debug toolbar was unable to parse value'
31+
return "Debug toolbar was unable to parse value"
3432

3533
self.record_stats(
3634
{

tests/panels/test_settings.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@
33
from ..base import IntegrationTestCase
44

55

6-
@override_settings(DEBUG=True, RANDOM_SETTING=bytes.fromhex("a3f2b8c14e972d5a8fb3c7291a64e0859c472bf63d18a0945e73b2c84f917ae2"))
6+
@override_settings(
7+
DEBUG=True,
8+
RANDOM_SETTING=bytes.fromhex(
9+
"a3f2b8c14e972d5a8fb3c7291a64e0859c472bf63d18a0945e73b2c84f917ae2"
10+
),
11+
)
712
class SettingsIntegrationTestCase(IntegrationTestCase):
813
def test_panel_title(self):
914
response = self.client.get("/regular/basic/")

0 commit comments

Comments
 (0)