diff --git a/pagure/api/__init__.py b/pagure/api/__init__.py index 5ed6023..fc65844 100644 --- a/pagure/api/__init__.py +++ b/pagure/api/__init__.py @@ -284,8 +284,8 @@ def api_users(): 'mention': [{ 'username': usr.username, 'name': usr.fullname, - 'image': pagure.lib.avatar_url_from_openid(usr.default_email, - size=16) + 'image': pagure.lib.avatar_url_from_email( + usr.default_email, size=16) } for usr in users] } ) diff --git a/pagure/api/issue.py b/pagure/api/issue.py index ad0ddfc..9df2ff3 100644 --- a/pagure/api/issue.py +++ b/pagure/api/issue.py @@ -474,7 +474,7 @@ def api_view_issue_comment( 404, error_code=APIERROR.ENOCOMMENT) output = comment.to_json(public=True) - output['avatar_url'] = pagure.lib.avatar_url_from_openid( + output['avatar_url'] = pagure.lib.avatar_url_from_email( comment.user.default_email, size=16) output['comment_date'] = comment.date_created.strftime( '%Y-%m-%d %H:%M:%S') diff --git a/pagure/lib/__init__.py b/pagure/lib/__init__.py index 3abb384..a753b25 100644 --- a/pagure/lib/__init__.py +++ b/pagure/lib/__init__.py @@ -301,7 +301,7 @@ def add_issue_comment(session, issue, comment, user, ticketfolder, 'project': issue.project.fullname, 'comment_added': text2markdown(issue_comment.comment), 'comment_user': issue_comment.user.user, - 'avatar_url': avatar_url_from_openid( + 'avatar_url': avatar_url_from_email( issue_comment.user.default_email, size=16), 'comment_date': issue_comment.date_created.strftime( '%Y-%m-%d %H:%M:%S'), @@ -899,7 +899,7 @@ def add_pull_request_comment(session, request, commit, tree_id, filename, 'comment_added': comment_text, 'comment_user': pr_comment.user.user, 'comment_id': pr_comment.id, - 'avatar_url': avatar_url_from_openid( + 'avatar_url': avatar_url_from_email( pr_comment.user.default_email, size=16), 'comment_date': pr_comment.date_created.strftime( '%Y-%m-%d %H:%M:%S'), @@ -983,7 +983,7 @@ def edit_comment(session, parent, comment, user, 'comment_id': comment.id, 'parent_id': comment.parent.id, 'comment_editor': user_obj.user, - 'avatar_url': avatar_url_from_openid( + 'avatar_url': avatar_url_from_email( comment.user.default_email, size=16), 'comment_date': comment.edited_on.strftime( '%Y-%m-%d %H:%M:%S'), diff --git a/pagure/ui/filters.py b/pagure/ui/filters.py index b05b17d..092b77b 100644 --- a/pagure/ui/filters.py +++ b/pagure/ui/filters.py @@ -275,7 +275,7 @@ def avatar_url(email, size=64): """ Template filter sorting the given branches, Fedora first then EPEL, then whatever is left. """ - return pagure.lib.avatar_url_from_openid(email, size) + return pagure.lib.avatar_url_from_email(email, size) @APP.template_filter('short') diff --git a/tests/test_pagure_lib.py b/tests/test_pagure_lib.py index a781f20..84483b1 100644 --- a/tests/test_pagure_lib.py +++ b/tests/test_pagure_lib.py @@ -1131,16 +1131,16 @@ class PagureLibtests(tests.Modeltests): user = pagure.lib.search_user(self.session, username='foo') self.assertEqual(user.public_ssh_key, None) - def test_avatar_url_from_openid(self): + def avatar_url_from_email(self): """ Test the avatar_url_from_openid of pagure.lib. """ - output = pagure.lib.avatar_url_from_openid('pingou@fedoraproject.org') + output = pagure.lib.avatar_url_from_email('pingou@fedoraproject.org') self.assertEqual( output, 'https://seccdn.libravatar.org/avatar/' 'b3ee7bb4de70b6522c2478df3b4cd6322b5ec5d62ac7ceb1128e3d4ff42f6928' '?s=64&d=retro') - output = pagure.lib.avatar_url_from_openid(u'zoé@çëfò.org') + output = pagure.lib.avatar_url_from_email(u'zoé@çëfò.org') self.assertEqual( output, 'https://seccdn.libravatar.org/avatar/'