Show More
@@ -751,14 +751,14 b' HasReposGroupPermissionAny' | |||||
751 |
|
751 | |||
752 | def gravatar_url(email_address, size=30): |
|
752 | def gravatar_url(email_address, size=30): | |
753 | from pylons import url # doh, we need to re-import url to mock it later |
|
753 | from pylons import url # doh, we need to re-import url to mock it later | |
754 |
|
754 | _def = 'anonymous@rhodecode.org' | ||
755 |
|
|
755 | use_gravatar = str2bool(config['app_conf'].get('use_gravatar')) | |
756 | not email_address or email_address == 'anonymous@rhodecode.org'): |
|
756 | email_address = email_address or _def | |
|
757 | if (not use_gravatar or not email_address or email_address == _def): | |||
757 | f = lambda a, l: min(l, key=lambda x: abs(x - a)) |
|
758 | f = lambda a, l: min(l, key=lambda x: abs(x - a)) | |
758 | return url("/images/user%s.png" % f(size, [14, 16, 20, 24, 30])) |
|
759 | return url("/images/user%s.png" % f(size, [14, 16, 20, 24, 30])) | |
759 |
|
760 | |||
760 |
if |
|
761 | if use_gravatar and config['app_conf'].get('alternative_gravatar_url'): | |
761 | config['app_conf'].get('alternative_gravatar_url')): |
|
|||
762 | tmpl = config['app_conf'].get('alternative_gravatar_url', '') |
|
762 | tmpl = config['app_conf'].get('alternative_gravatar_url', '') | |
763 | parsed_url = urlparse.urlparse(url.current(qualified=True)) |
|
763 | parsed_url = urlparse.urlparse(url.current(qualified=True)) | |
764 | tmpl = tmpl.replace('{email}', email_address)\ |
|
764 | tmpl = tmpl.replace('{email}', email_address)\ |
General Comments 0
You need to be logged in to leave comments.
Login now