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
0636d02e
Commit
0636d02e
authored
Feb 20, 2015
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Switch to new Django API for caches
Fixes #631 Signed-off-by:
Michal Čihař
<
michal@cihar.com
>
parent
46400123
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
weblate/accounts/avatar.py
weblate/accounts/avatar.py
+4
-4
No files found.
weblate/accounts/avatar.py
View file @
0636d02e
...
...
@@ -22,7 +22,7 @@ import urllib2
import
urllib
import
hashlib
import
os.path
from
django.core.cache
import
get_cache
,
InvalidCacheBackendError
from
django.core.cache
import
caches
,
InvalidCacheBackendError
from
django.utils.html
import
escape
from
django.utils.safestring
import
mark_safe
from
django.utils.translation
import
pgettext
...
...
@@ -50,7 +50,7 @@ def avatar_for_email(email, size=80):
# Retrieve from cache
cache_key
=
'avatar-{0}-{1}'
.
format
(
email
,
size
)
cache
=
get_cache
(
'default'
)
cache
=
caches
[
'default'
]
url
=
cache
.
get
(
cache_key
)
if
url
is
not
None
:
return
url
...
...
@@ -117,9 +117,9 @@ def get_avatar_image(user, size):
# Try using avatar specific cache if available
try
:
cache
=
get_cache
(
'avatar'
)
cache
=
caches
[
'avatar'
]
except
InvalidCacheBackendError
:
cache
=
get_cache
(
'default'
)
cache
=
caches
[
'default'
]
image
=
cache
.
get
(
cache_key
)
if
image
is
None
:
...
...
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