Skip to content

Commit 59fa751

Browse files
committed
Merge pull request #376 from midiotthimble/sql-panel-refactor
Fixes UnicodeEncodeError sometimes
2 parents 1390c40 + d591337 commit 59fa751

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

debug_toolbar/forms.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from django import forms
22
from django.conf import settings
3+
from django.utils.encoding import smart_str
34
from django.core.exceptions import ValidationError
45

56
from debug_toolbar.utils.functional import cached_property
@@ -82,7 +83,7 @@ def reformat_sql(self):
8283

8384
def make_hash(self, data):
8485
params = settings.SECRET_KEY + data['sql'] + data['params']
85-
return sha1(params).hexdigest()
86+
return sha1(smart_str(params)).hexdigest()
8687

8788
@property
8889
def connection(self):

0 commit comments

Comments
 (0)