Commit 8bab0284 authored by Michal Čihař's avatar Michal Čihař

Ensure cache key does not contain spaces

Fixes rb#195
Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 47740994
......@@ -51,7 +51,10 @@ def avatar_for_email(email, size=80):
email = 'noreply@weblate.org'
# Retrieve from cache
cache_key = 'avatar-{0}-{1}'.format(email, size)
cache_key = 'avatar-{0}-{1}'.format(
email.encode('base64'),
size
)
cache = caches['default']
url = cache.get(cache_key)
if url is not None:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment