From 301166b8d61d39f29a614bb56a22c02a9f76a1c0 Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Thu, 6 May 2010 00:53:53 +0200 Subject: [PATCH] The default avatar URL could also start with https. --- avatar/util.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/avatar/util.py b/avatar/util.py index c4f6021..d3528fa 100644 --- a/avatar/util.py +++ b/avatar/util.py @@ -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('/')