Show More
@@ -749,7 +749,13 b' HasRepoPermissionAny, HasRepoPermissionA' | |||||
749 | #============================================================================== |
|
749 | #============================================================================== | |
750 |
|
750 | |||
751 | def gravatar_url(email_address, size=30): |
|
751 | def gravatar_url(email_address, size=30): | |
752 |
from pylons import url |
|
752 | from pylons import url # doh, we need to re-import url to mock it later | |
|
753 | ||||
|
754 | if (not str2bool(config['app_conf'].get('use_gravatar')) or | |||
|
755 | not email_address or email_address == 'anonymous@rhodecode.org'): | |||
|
756 | 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 | ||||
753 | if(str2bool(config['app_conf'].get('use_gravatar')) and |
|
759 | if(str2bool(config['app_conf'].get('use_gravatar')) and | |
754 | config['app_conf'].get('alternative_gravatar_url')): |
|
760 | config['app_conf'].get('alternative_gravatar_url')): | |
755 | tmpl = config['app_conf'].get('alternative_gravatar_url', '') |
|
761 | tmpl = config['app_conf'].get('alternative_gravatar_url', '') | |
@@ -761,11 +767,6 b' def gravatar_url(email_address, size=30)' | |||||
761 | .replace('{size}', str(size)) |
|
767 | .replace('{size}', str(size)) | |
762 | return tmpl |
|
768 | return tmpl | |
763 |
|
769 | |||
764 | if (not str2bool(config['app_conf'].get('use_gravatar')) or |
|
|||
765 | not email_address or email_address == 'anonymous@rhodecode.org'): |
|
|||
766 | f = lambda a, l: min(l, key=lambda x: abs(x - a)) |
|
|||
767 | return url("/images/user%s.png" % f(size, [14, 16, 20, 24, 30])) |
|
|||
768 |
|
||||
769 | ssl_enabled = 'https' == request.environ.get('wsgi.url_scheme') |
|
770 | ssl_enabled = 'https' == request.environ.get('wsgi.url_scheme') | |
770 | default = 'identicon' |
|
771 | default = 'identicon' | |
771 | baseurl_nossl = "http://www.gravatar.com/avatar/" |
|
772 | baseurl_nossl = "http://www.gravatar.com/avatar/" |
General Comments 0
You need to be logged in to leave comments.
Login now