Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
7682cd7a
Commit
7682cd7a
authored
Mar 19, 2013
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass all params to libravatar
parent
3032b840
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
9 deletions
+15
-9
trans/util.py
trans/util.py
+15
-9
No files found.
trans/util.py
View file @
7682cd7a
...
...
@@ -55,19 +55,25 @@ def avatar_for_email(email, size=80):
Generates url for avatar.
'''
# Use libravatar library if available
if
HAS_LIBRAVATAR
:
return
escape
(
libravatar
.
libravatar_url
(
email
=
email
,
https
=
True
))
# Use libravatar library if available
url
=
libravatar
.
libravatar_url
(
email
=
email
,
https
=
True
,
default
=
AVATAR_DEFAULT_IMAGE
,
size
=
size
)
# Fallback to standard method
mail_hash
=
hashlib
.
md5
(
email
.
lower
()).
hexdigest
()
else
:
# Fallback to standard method
mail_hash
=
hashlib
.
md5
(
email
.
lower
()).
hexdigest
()
url
=
"%savatar/%s?"
%
(
AVATAR_URL_PREFIX
,
mail_hash
)
url
=
"%savatar/%s?"
%
(
AVATAR_URL_PREFIX
,
mail_hash
)
url
+=
urllib
.
urlencode
({
's'
:
str
(
size
),
'd'
:
AVATAR_DEFAULT_IMAGE
})
url
+=
urllib
.
urlencode
({
's'
:
str
(
size
),
'd'
:
AVATAR_DEFAULT_IMAGE
})
return
escape
(
url
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment