Browse Source
[IMP] base_user_gravatar: changes to get Gravatars over HTTPS
pull/1015/head
Naglis Jonaitis
7 years ago
No known key found for this signature in database
GPG Key ID: 4748835F585390F5
3 changed files with
3 additions and
3 deletions
-
base_user_gravatar/__manifest__.py
-
base_user_gravatar/models/res_users.py
-
base_user_gravatar/tests/test_res_users.py
|
|
@ -4,7 +4,7 @@ |
|
|
|
|
|
|
|
{ |
|
|
|
'name': 'Synchronize Gravatar Image', |
|
|
|
'version': '10.0.1.0.0', |
|
|
|
'version': '10.0.1.0.1', |
|
|
|
'author': 'LasLabs, Endika Iglesias, Odoo Community Association (OCA)', |
|
|
|
'category': 'Tools', |
|
|
|
'website': 'https://odoo-community.org/', |
|
|
|
|
|
@ -15,7 +15,7 @@ class ResUsers(models.Model): |
|
|
|
_inherit = 'res.users' |
|
|
|
|
|
|
|
def _get_gravatar_base64(self, email=''): |
|
|
|
url = 'http://www.gravatar.com/avatar/{}?s=200' |
|
|
|
url = 'https://www.gravatar.com/avatar/{}?s=200' |
|
|
|
_hash = hashlib.md5(email).hexdigest() |
|
|
|
try: |
|
|
|
res = urllib2.urlopen(url.format(_hash)) |
|
|
|
|
|
@ -24,7 +24,7 @@ class TestResUsers(TransactionCase): |
|
|
|
'name': 'Test', |
|
|
|
'login': 'test_login', |
|
|
|
} |
|
|
|
self.url = 'http://www.gravatar.com/avatar/{}?s=200' |
|
|
|
self.url = 'https://www.gravatar.com/avatar/{}?s=200' |
|
|
|
|
|
|
|
def _test_record(self, ): |
|
|
|
partner_id = self.env['res.partner'].create(self.partner_vals) |
|
|
|