Ask Your Question
1

Gravatar Hashes having an extra 's'

asked 2011-01-31 16:13:57 -0500

Ben gravatar image Ben
43 1 6

updated 2011-02-03 16:59:45 -0500

Evgeny gravatar image Evgeny flag of Chile
11044 50 84 182
http://askbot.org/

Hi,

I've noticed gravatar hashes get an extra 's' after the actual hash. It seems to be because of the code in in askbot-0.6.65-py2.6.egg\askbot\templatetags\extra_tags.py@L16 which should be:

                     'src="http://www.gravatar.com/avatar/%(gravatar_hash)'

instead of

                     'src="http://www.gravatar.com/avatar/%(gravatar_hash)s'

As of now, it prevents me from getting my actual updated gravatar image. Is it a typo or is it normal?

As a side note.. I've changed the aforementionned file code, removed all PYC files in askbot directory, restarted the web server and emptied my browser cache but, still, it does not fix it. What am I doing wrong? (Sorry, first time with Django!)

Thanks for your time and consideration!

Ben

delete close flag offensive retag edit

Comments

retagged as bug again, will remove this issue in the next release (I make them often, sometimes more than once a week). I've edited out the issue on this site, since it was a matter of just deleting a character. Evgeny ( 2011-01-31 16:43:43 -0500 )edit

3 Answers

Sort by ยป oldest newest most voted
1

answered 2011-01-31 16:20:01 -0500

Evgeny gravatar image Evgeny flag of Chile
11044 50 84 182
http://askbot.org/

updated 2011-01-31 16:48:01 -0500

Ben, I think that your gravatar change has not yet propagated through various caches, there is no problem with retrieving the images as you can see on this site.

the extra "s" is a formatting character for a string substitution, it is necessary to recognize the "gravatar_hash" variable as string and insert the value into the url.

Here are python docs on string formatting.

edit actually you are right, the gravatars have an extra s that does not belong there, but apparently it has no effect. Looks like you've discovered a "gravatar law". In fact it does not change if you append more characters.

The extra "s" comes from a template macro "gravatar" in file askbot/skins/default/templates/macros.html. The code that you've mentioned is not in use now, will eventually be removed.

link publish delete flag offensive edit
1

answered 2011-01-31 16:30:44 -0500

Ben gravatar image Ben
43 1 6

updated 2011-01-31 16:34:34 -0500

Right on, Evgeny. There is indeed a cache issue here.

Still, all pictures hashes end with the 's' character. Right on this question page, for instance, your gravatar picture URI is:

http://www.gravatar.com/avatar/db77fe6f52095bd53cbd53a406e2c4b2s?s=32&d=identicon&r=PG

whereas

http://www.gravatar.com/avatar/db77fe6f52095bd53cbd53a406e2c4b2?s=32&d=identicon&r=PG

would work (better?)

For instance, take a look at mine:

http://www.gravatar.com/avatar/4d8dff2584ac29510f092808ea3afee5s?s=128&d=identicon&r=PG

returns a different picture than

http://www.gravatar.com/avatar/4d8dff2584ac29510f092808ea3afee5?s=128&d=identicon&r=PG

Edit: I read Python docs, and while I completely agree with you and the documentation, I do not get why the results are what they are... this is disturbing. Anyway, as you mentionned, the gravatar images are getting updated so it's not very important. :-)

Thanks for your time anyway!

link publish delete flag offensive edit
0

answered 2011-01-31 16:50:01 -0500

Ben gravatar image Ben
43 1 6

Nice, your fix totally works!

Have a nice evening :-)

link publish delete flag offensive edit

Your answer

Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Reliable Askbot Hosting

Create your Q&A site at askbot.com. Managed Askbot hosting at just $15/mo. Dedicated hosting, support contracts, consulting services.

create your Q&A site
30 days free trial

Question tools

Follow

subscribe to rss feed

Stats

Asked: 2011-01-31 16:13:57 -0500

Seen: 58 times

Last updated: Jan 31 '11