diff options
| author | Vladislav Poluhin | 2013-04-25 10:41:58 +0800 |
|---|---|---|
| committer | Vladislav Poluhin | 2013-04-25 10:41:58 +0800 |
| commit | d59133709a3ee213ceff7c65dc03cfee9b00b8d2 (patch) | |
| tree | f1ffc95e9b15ff7fe06e096fc5d227cfcde50e4f /debug_toolbar/forms.py | |
| parent | f6b515f71aea595c303d287f121a34ec31c4784c (diff) | |
| download | django-debug-toolbar-d59133709a3ee213ceff7c65dc03cfee9b00b8d2.tar.bz2 | |
Fixes UnicodeEncodeError sometimes
Diffstat (limited to 'debug_toolbar/forms.py')
| -rw-r--r-- | debug_toolbar/forms.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/debug_toolbar/forms.py b/debug_toolbar/forms.py index 9793f5e..f93abf7 100644 --- a/debug_toolbar/forms.py +++ b/debug_toolbar/forms.py @@ -1,5 +1,6 @@ from django import forms from django.conf import settings +from django.utils.encoding import smart_str from django.core.exceptions import ValidationError from debug_toolbar.utils.functional import cached_property @@ -82,7 +83,7 @@ class SQLSelectForm(forms.Form): def make_hash(self, data): params = settings.SECRET_KEY + data['sql'] + data['params'] - return sha1(params).hexdigest() + return sha1(smart_str(params)).hexdigest() @property def connection(self): |
