diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2008-09-02 03:04:28 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2008-09-02 03:04:28 +0000 |
| commit | 63c9b7bf06f37268ae1dcb3e90232adce9441085 (patch) | |
| tree | 2cbfe312174b17c49873c8fd3a81ed19b1e239f4 | |
| parent | 54e02cc92be7f89ee625307b03904dfa93fceab4 (diff) | |
Avoid a deprecation warning when running on Python 2.6. Patch from Karen Tracey.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8841 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | django/contrib/comments/forms.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/django/contrib/comments/forms.py b/django/contrib/comments/forms.py index 58af4466d0..39016d84cf 100644 --- a/django/contrib/comments/forms.py +++ b/django/contrib/comments/forms.py @@ -1,7 +1,7 @@ import re import time import datetime -from sha import sha + from django import forms from django.forms.util import ErrorDict from django.conf import settings @@ -9,6 +9,7 @@ from django.http import Http404 from django.contrib.contenttypes.models import ContentType from models import Comment from django.utils.encoding import force_unicode +from django.utils.hashcompat import sha_constructor from django.utils.text import get_text_list from django.utils.translation import ngettext from django.utils.translation import ugettext_lazy as _ @@ -154,4 +155,4 @@ class CommentForm(forms.Form): def generate_security_hash(self, content_type, object_pk, timestamp): """Generate a (SHA1) security hash from the provided info.""" info = (content_type, object_pk, timestamp, settings.SECRET_KEY) - return sha("".join(info)).hexdigest() + return sha_constructor("".join(info)).hexdigest() |
