summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvgeny Fadeev <evgeny.fadeev@gmail.com>2010-10-21 14:03:43 -0400
committerEvgeny Fadeev <evgeny.fadeev@gmail.com>2010-10-21 14:03:43 -0400
commit79a445dea600402535eb801034465f4d42356a0e (patch)
tree2b92ae188ea553b3f720f6db9ab8823fa76d2840
parent366c6f7a42ae0a0f9bfc1765a912611469f119f1 (diff)
downloadaskbot-79a445dea600402535eb801034465f4d42356a0e.tar.gz
askbot-79a445dea600402535eb801034465f4d42356a0e.tar.bz2
askbot-79a445dea600402535eb801034465f4d42356a0e.zip
added lowercasing and whitespace-stripping of email for gravatar hash calculation
-rw-r--r--askbot/models/__init__.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/askbot/models/__init__.py b/askbot/models/__init__.py
index ba274969..ef53828a 100644
--- a/askbot/models/__init__.py
+++ b/askbot/models/__init__.py
@@ -1575,7 +1575,8 @@ def calculate_gravatar_hash(instance, **kwargs):
"""Calculates a User's gravatar hash from their email address."""
if kwargs.get('raw', False):
return
- instance.gravatar = hashlib.md5(instance.email).hexdigest()
+ clean_email = instance.email.strip().lower()
+ instance.gravatar = hashlib.md5(clean_email).hexdigest()
def record_post_update_activity(