Mercurial > public > sg101
diff core/management/commands/ssl_images.py @ 986:26de15fb5a80
Guard against bad image urls in ssl_images.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sun, 25 Oct 2015 14:47:29 -0500 |
parents | 7db9037915c4 |
children | 76525f5ac2b1 |
line wrap: on
line diff
--- a/core/management/commands/ssl_images.py Sun Oct 25 13:54:56 2015 -0500 +++ b/core/management/commands/ssl_images.py Sun Oct 25 14:47:29 2015 -0500 @@ -191,7 +191,11 @@ new_src = None if src: - r = urlparse.urlparse(src) + try: + r = urlparse.urlparse(src) + except ValueError: + return u'{bad image}' + if r.hostname in SG101_HOSTS: new_src = r.path # convert to relative path elif r.scheme == 'http':