aboutsummaryrefslogtreecommitdiffstats
path: root/debug_toolbar/forms.py
diff options
context:
space:
mode:
authorAymeric Augustin2013-10-16 22:14:41 +0200
committerAymeric Augustin2013-10-17 18:24:57 +0200
commitc1f39b1a168d535e0b90d3c69273e391adf22637 (patch)
tree9ae12cb257585e4681edea253209d9c150f3731a /debug_toolbar/forms.py
parent79831e4053b472921621f288483e95a961a4d142 (diff)
downloaddjango-debug-toolbar-c1f39b1a168d535e0b90d3c69273e391adf22637.tar.bz2
Remove compatibility code for unsupported version of Django.
Diffstat (limited to 'debug_toolbar/forms.py')
-rw-r--r--debug_toolbar/forms.py20
1 files changed, 6 insertions, 14 deletions
diff --git a/debug_toolbar/forms.py b/debug_toolbar/forms.py
index f93abf7..c661c9e 100644
--- a/debug_toolbar/forms.py
+++ b/debug_toolbar/forms.py
@@ -1,23 +1,15 @@
+import json
+import hashlib
+
from django import forms
from django.conf import settings
+from django.db import connections
from django.utils.encoding import smart_str
+from django.utils.functional import cached_property
from django.core.exceptions import ValidationError
-from debug_toolbar.utils.functional import cached_property
from debug_toolbar.utils.sql import reformat_sql
-try:
- import json
-except ImportError:
- from django.utils import simplejson as json
-
-try:
- from hashlib import sha1
-except ImportError:
- from django.utils.hashcompat import sha_constructor as sha1
-
-from debug_toolbar.utils.compat.db import connections
-
class SQLSelectForm(forms.Form):
"""
@@ -83,7 +75,7 @@ class SQLSelectForm(forms.Form):
def make_hash(self, data):
params = settings.SECRET_KEY + data['sql'] + data['params']
- return sha1(smart_str(params)).hexdigest()
+ return hashlib.sha1(smart_str(params)).hexdigest()
@property
def connection(self):