From ed9881478d064e55679a2eb684c29baf1939776c Mon Sep 17 00:00:00 2001 From: Joseph Date: Thu, 16 Jul 2015 23:44:55 -0700 Subject: Skip absolute path substitution where STATIC or MEDIA URL is not set STATIC_URL or MEDIA_URL settings default to '' and None These default values cause the url match and replace algorithm to insert the *_ROOT setting in EVERY quoted string!! --- wkhtmltopdf/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wkhtmltopdf/utils.py b/wkhtmltopdf/utils.py index 603d29a..e841380 100644 --- a/wkhtmltopdf/utils.py +++ b/wkhtmltopdf/utils.py @@ -152,7 +152,7 @@ def make_absolute_paths(content): has_scheme = re.compile(r'^[^:/]+://') for x in overrides: - if has_scheme.match(x['url']): + if not x['url'] or has_scheme.match(x['url']): continue if not x['root'].endswith('/'): -- cgit v1.2.3