Use Python 3 compat import location for urlparse.

This commit is contained in:
Jannis Leidel 2013-08-01 13:34:55 +02:00
parent 39ecc33ced
commit 286df0db56

View file

@ -1,7 +1,11 @@
import urllib
import urlparse
import hashlib
try:
from urllib.parse import urljoin
except ImportError:
from urlparse import urljoin
from django import template
from django.core.urlresolvers import reverse
from django.template.loader import render_to_string
@ -30,7 +34,7 @@ def avatar_url(user, size=AVATAR_DEFAULT_SIZE):
params['d'] = AVATAR_GRAVATAR_DEFAULT
path = "%s/?%s" % (hashlib.md5(user.email).hexdigest(),
urllib.urlencode(params))
return urlparse.urljoin(AVATAR_GRAVATAR_BASE_URL, path)
return urljoin(AVATAR_GRAVATAR_BASE_URL, path)
return get_default_avatar_url()