Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions web/pgadmin/browser/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,13 +383,13 @@ def _get_supported_browser():


@blueprint.add_app_template_filter
def gravatar(username):
def gravatar(identifier):
"""
This function adds a template filter which
returns gravatar image for user.
:return: gravatar image
"""
g = Gravatar(username)
g = Gravatar(identifier)
return g.get_image(
size=100,
rating='g',
Expand Down Expand Up @@ -555,6 +555,7 @@ def utils():
is_admin=current_user.has_role("Administrator"),
login_url=login_url,
username=current_user.username.replace("'","\\'"),
gravatar_identifier=current_user.email or current_user.username,
auth_source=auth_source,
heartbeat_timeout=config.SERVER_HEARTBEAT_TIMEOUT,
password_length_min=config.PASSWORD_LENGTH_MIN,
Expand Down
2 changes: 1 addition & 1 deletion web/pgadmin/browser/templates/browser/js/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ define('pgadmin.browser.utils',
userMenuInfo: {
username: '{{username}}',
auth_source: '{{auth_source}}',
gravatar: {% if config.SHOW_GRAVATAR_IMAGE %}'{{ username | gravatar }}'{% else %}''{% endif %},
gravatar: {% if config.SHOW_GRAVATAR_IMAGE %}'{{ gravatar_identifier | gravatar }}'{% else %}''{% endif %},
menus: [
{% if auth_only_internal %}
{
Expand Down