Commits

Christian Scholz  committed ebd8ac4

user icon URL now points to local profile pic instead of gravatar

  • Participants
  • Parent commits ae51425

Comments (0)

Files changed (1)

File adhocracy/lib/helpers/user_helper.py

 
 @cache.memoize('user_icon')
 def icon_url(user, size=32):
-    id = user.email if user.email else user.user_name
-    gravatar_url = "http://www.gravatar.com/avatar.php?"
-    gravatar_url += urllib.urlencode({
-        'gravatar_id': hashlib.md5(id.strip().lower()).hexdigest(), 
-        'default': 'identicon', 
-        'size': str(size)})
-    return gravatar_url
+    fn = hashlib.new("md5", str(user.id)).hexdigest()
+    pic_url = u"/profilepics/%s_%s.png" %(fn, size)
+    return pic_url
 
 
 def link(user, size=16, scope=None):
     if user is not None:
         bc += bc_entity(user)
     return bc
-    
+