summaryrefslogtreecommitdiff
path: root/django/contrib/formtools
diff options
context:
space:
mode:
authorJustin Bronn <jbronn@gmail.com>2008-08-05 17:15:33 +0000
committerJustin Bronn <jbronn@gmail.com>2008-08-05 17:15:33 +0000
commitaa239e3e5405933af6a29dac3cf587b59a099927 (patch)
treeea2cbd139c9a8cf84c09e0b2008bff70e05927ef /django/contrib/formtools
parent45b73c9a4685809236f84046cc7ffd32a50db958 (diff)
downloaddjango-attic/gis.tar.gz
gis: Merged revisions 7981-8001,8003-8011,8013-8033,8035-8036,8038-8039,8041-8063,8065-8076,8078-8139,8141-8154,8156-8214 via svnmerge from trunk.archive/attic/gisattic/gis
git-svn-id: http://code.djangoproject.com/svn/django/branches/gis@8215 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/contrib/formtools')
-rw-r--r--django/contrib/formtools/preview.py7
-rw-r--r--django/contrib/formtools/tests.py1
-rw-r--r--django/contrib/formtools/wizard.py7
3 files changed, 8 insertions, 7 deletions
diff --git a/django/contrib/formtools/preview.py b/django/contrib/formtools/preview.py
index db5d58e971..c56fdff628 100644
--- a/django/contrib/formtools/preview.py
+++ b/django/contrib/formtools/preview.py
@@ -2,12 +2,13 @@
Formtools Preview application.
"""
+import cPickle as pickle
+
from django.conf import settings
from django.http import Http404
from django.shortcuts import render_to_response
from django.template.context import RequestContext
-import cPickle as pickle
-import md5
+from django.utils.hashcompat import md5_constructor
AUTO_ID = 'formtools_%s' # Each form here uses this as its auto_id parameter.
@@ -109,7 +110,7 @@ class FormPreview(object):
# Use HIGHEST_PROTOCOL because it's the most efficient. It requires
# Python 2.3, but Django requires 2.3 anyway, so that's OK.
pickled = pickle.dumps(data, pickle.HIGHEST_PROTOCOL)
- return md5.new(pickled).hexdigest()
+ return md5_constructor(pickled).hexdigest()
def failed_hash(self, request):
"Returns an HttpResponse in the case of an invalid security hash."
diff --git a/django/contrib/formtools/tests.py b/django/contrib/formtools/tests.py
index 99fe80bbb3..2ea0cc90a4 100644
--- a/django/contrib/formtools/tests.py
+++ b/django/contrib/formtools/tests.py
@@ -1,7 +1,6 @@
from django import forms
from django.contrib.formtools import preview
from django import http
-from django.conf import settings
from django.test import TestCase
success_string = "Done was called!"
diff --git a/django/contrib/formtools/wizard.py b/django/contrib/formtools/wizard.py
index 7b96d91187..984b6e487e 100644
--- a/django/contrib/formtools/wizard.py
+++ b/django/contrib/formtools/wizard.py
@@ -4,13 +4,14 @@ step and storing the form's state as HTML hidden fields so that no state is
stored on the server side.
"""
+import cPickle as pickle
+
from django import forms
from django.conf import settings
from django.http import Http404
from django.shortcuts import render_to_response
from django.template.context import RequestContext
-import cPickle as pickle
-import md5
+from django.utils.hashcompat import md5_constructor
class FormWizard(object):
# Dictionary of extra template context variables.
@@ -150,7 +151,7 @@ class FormWizard(object):
# Use HIGHEST_PROTOCOL because it's the most efficient. It requires
# Python 2.3, but Django requires 2.3 anyway, so that's OK.
pickled = pickle.dumps(data, pickle.HIGHEST_PROTOCOL)
- return md5.new(pickled).hexdigest()
+ return md5_constructor(pickled).hexdigest()
def determine_step(self, request, *args, **kwargs):
"""