Author: mtredinnick
Date: 2008-09-01 22:04:28 -0500 (Mon, 01 Sep 2008)
New Revision: 8841
Modified:
django/trunk/django/contrib/comments/forms.py
Log:
Avoid a deprecation warning when running on Python 2.6. Patch from Karen Tracey.
Modified: django/trunk/django/contrib/comments/forms.py
===================================================================
--- django/trunk/django/contrib/comments/forms.py 2008-09-02 02:50:23 UTC
(rev 8840)
+++ django/trunk/django/contrib/comments/forms.py 2008-09-02 03:04:28 UTC
(rev 8841)
@@ -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.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 @@
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()
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---