The default avatar URL could also start with https.

This commit is contained in:
Jannis Leidel 2010-05-06 00:53:53 +02:00
parent 61879cee7e
commit 301166b8d6

View file

@ -8,8 +8,8 @@ def get_default_avatar_url():
base_url = getattr(settings, 'STATIC_URL', None)
if not base_url:
base_url = getattr(settings, 'MEDIA_URL', '')
# Don't use base_url if the default avatar url starts with http://
if AVATAR_DEFAULT_URL.startswith('http://'):
# Don't use base_url if the default avatar url starts with http:// of https://
if AVATAR_DEFAULT_URL.startswith('http://') or AVATAR_DEFAULT_URL.startswith('https://'):
return AVATAR_DEFAULT_URL
# We'll be nice and make sure there are no duplicated forward slashes
ends = base_url.endswith('/')