# HG changeset patch # User domruf # Date 2012-08-14 13:21:50 # Node ID d62f0959024674afdb7cef315fd574b86c85eb41 # Parent 298bac3757a71a212d1369169a3543b054b02e88 allow alternative gravatar URL diff --git a/rhodecode/lib/helpers.py b/rhodecode/lib/helpers.py --- a/rhodecode/lib/helpers.py +++ b/rhodecode/lib/helpers.py @@ -692,6 +692,10 @@ HasRepoPermissionAny, HasRepoPermissionA #============================================================================== def gravatar_url(email_address, size=30): + if(config['app_conf'].get('alternative_gravatar')): + if(str2bool(config['app_conf'].get('alternative_gravatar_hash'))): + email_address = hashlib.md5(email_address.lower()).hexdigest() + return "%s/%s?s=%s" % (config['app_conf'].get('alternative_gravatar').strip('/'), email_address, size) if (not str2bool(config['app_conf'].get('use_gravatar')) or not email_address or email_address == 'anonymous@rhodecode.org'): f = lambda a, l: min(l, key=lambda x: abs(x - a))