diff --git a/rhodecode/lib/base.py b/rhodecode/lib/base.py --- a/rhodecode/lib/base.py +++ b/rhodecode/lib/base.py @@ -11,6 +11,7 @@ from pylons.templating import render_mak from paste.deploy.converters import asbool from rhodecode import __version__ +from rhodecode.lib import str2bool from rhodecode.lib.auth import AuthUser, get_container_username from rhodecode.lib.utils import get_repo_slug from rhodecode.model import meta @@ -25,6 +26,7 @@ class BaseController(WSGIController): def __before__(self): c.rhodecode_version = __version__ c.rhodecode_name = config.get('rhodecode_title') + c.use_gravatar = str2bool(config.get('use_gravatar')) c.ga_code = config.get('rhodecode_ga_code') c.repo_name = get_repo_slug(request) c.backends = BACKENDS.keys() diff --git a/rhodecode/lib/helpers.py b/rhodecode/lib/helpers.py --- a/rhodecode/lib/helpers.py +++ b/rhodecode/lib/helpers.py @@ -454,9 +454,8 @@ HasRepoPermissionAny, HasRepoPermissionA #============================================================================== def gravatar_url(email_address, size=30): - if not str2bool(config['app_conf'].get('use_gravatar')) or \ - not email_address or \ - email_address == 'anonymous@rhodecode.org': + if (not str2bool(config['app_conf'].get('use_gravatar')) or + not email_address or email_address == 'anonymous@rhodecode.org'): return url("/images/user%s.png" % size) ssl_enabled = 'https' == request.environ.get('wsgi.url_scheme') diff --git a/rhodecode/templates/admin/users/user_edit.html b/rhodecode/templates/admin/users/user_edit.html --- a/rhodecode/templates/admin/users/user_edit.html +++ b/rhodecode/templates/admin/users/user_edit.html @@ -29,10 +29,13 @@
- ${_('Change your avatar at')} gravatar.com
- ${_('Using')} ${c.user.email}
-
+ %if c.use_gravatar:
+ ${_('Change your avatar at')} gravatar.com
+
${_('Using')} ${c.user.email}
+ %else:
+
${c.user.email}
+ %endif
- ${_('Change your avatar at')} gravatar.com
- ${_('Using')} ${c.user.email}
+ %if c.use_gravatar:
+ ${_('Change your avatar at')} gravatar.com
+
${_('Using')} ${c.user.email}
+ %else:
+
${c.user.email}
+ %endif