Currently, the gravatar URL that gets the image for a user is constructed
as follows:
/gravatar/templatetags/gravatar.py:
def gravatar_for_email(email, size=80):
url = "%savatar/%s/" % (GRAVATAR_URL_PREFIX,
hashlib.md5(email).hexdigest())
url += urllib.urlencode({"s": str(size)})
return escape(url)
The problem is that it returns a url that's missing the query string separator:
http://www.gravatar.com/avatar/.../s=80
The result is that the s attribute is ignored, and the size 80 is always
return no matter what s is set to.
A simple fix is to add the "?" before the query string is appended to the url.
def gravatar_for_email(email, size=80):
url = "%savatar/%s/" % (GRAVATAR_URL_PREFIX,
hashlib.md5(email).hexdigest())
url += "?" + urllib.urlencode({"s": str(size)})
return escape(url)
This works as expected, and the image returned now responds to the s attribute.
Original issue reported on code.google.com by jim.ere....@gmail.com on 10 Sep 2008 at 6:02
Original issue reported on code.google.com by
jim.ere....@gmail.com
on 10 Sep 2008 at 6:02