From 51162d2f90e7e93b7842e215e0819a9a249224ed Mon Sep 17 00:00:00 2001 From: Brian Rosner Date: Sun, 5 Apr 2009 02:12:13 +0800 Subject: [PATCH] Fixed 2.6 DeprecationWarning with md5. Signed-off-by: Simon Willison --- django_openid/models.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/django_openid/models.py b/django_openid/models.py index 9771191..f48e0e8 100644 --- a/django_openid/models.py +++ b/django_openid/models.py @@ -1,9 +1,10 @@ from django.db import models from django.conf import settings +from django.utils.hashcompat import md5_constructor from openid.store.interface import OpenIDStore import openid.store from openid.association import Association as OIDAssociation -import time, base64, md5 +import time, base64 class Nonce(models.Model): server_url = models.CharField(max_length=255) @@ -108,7 +109,7 @@ def cleaupAssociations(self): def getAuthKey(self): # Use first AUTH_KEY_LEN characters of md5 hash of SECRET_KEY - return md5.new(settings.SECRET_KEY).hexdigest()[:self.AUTH_KEY_LEN] + return md5_constructor.new(settings.SECRET_KEY).hexdigest()[:self.AUTH_KEY_LEN] def isDumb(self): return False