Skip to content

Commit

Permalink
Fixed 2.6 DeprecationWarning with md5.
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Willison <simon@simonwillison.net>
  • Loading branch information
brosner authored and Simon Willison committed May 5, 2009
1 parent f509b84 commit 51162d2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions 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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 51162d2

Please sign in to comment.