Skip to content

Commit

Permalink
Let pisa handle remote resources
Browse files Browse the repository at this point in the history
  • Loading branch information
dulacp committed Dec 8, 2013
1 parent b622e45 commit e92304c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pdfutils/utils.py
Expand Up @@ -41,8 +41,11 @@ def fetch_resources(uri, rel):
Callback to allow xhtml2pdf/reportlab to retrieve Images,Stylesheets, etc.
`uri` is the href attribute from the html link element.
`rel` gives a relative path, but it's not used here.
"""
if uri.startswith('http://') or uri.startswith('https://'):
return uri

if uri.startswith(settings.MEDIA_URL):
path = os.path.join(settings.MEDIA_ROOT,
uri.replace(settings.MEDIA_URL, ""))
Expand Down

0 comments on commit e92304c

Please sign in to comment.