mirror of
https://github.com/jazzband/django-avatar.git
synced 2026-05-18 12:31:07 +00:00
Removed usage of hashlib to support Python 2.4.
git-svn-id: http://django-avatar.googlecode.com/svn/trunk@36 c76b2324-5f53-0410-85ac-b1078a54aeeb
This commit is contained in:
parent
221b52a65c
commit
adf694302b
1 changed files with 2 additions and 2 deletions
|
|
@ -1,9 +1,9 @@
|
|||
import hashlib
|
||||
import urllib
|
||||
|
||||
from django import template
|
||||
from django.contrib.auth.models import User
|
||||
from django.utils.translation import ugettext as _
|
||||
from django.utils.hashcompat import md5_constructor
|
||||
|
||||
from avatar import AVATAR_DEFAULT_URL, AVATAR_GRAVATAR_BACKUP
|
||||
|
||||
|
|
@ -30,7 +30,7 @@ def avatar_url(user, size=80):
|
|||
else:
|
||||
if AVATAR_GRAVATAR_BACKUP:
|
||||
return "http://www.gravatar.com/avatar/%s/?%s" % (
|
||||
hashlib.md5(user.email).hexdigest(),
|
||||
md5_constructor(user.email).hexdigest(),
|
||||
urllib.urlencode({'s': str(size)}),)
|
||||
else:
|
||||
return AVATAR_DEFAULT_URL
|
||||
|
|
|
|||
Loading…
Reference in a new issue