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