aboutsummaryrefslogtreecommitdiffstats
path: root/wkhtmltopdf/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'wkhtmltopdf/utils.py')
-rw-r--r--wkhtmltopdf/utils.py20
1 files changed, 8 insertions, 12 deletions
diff --git a/wkhtmltopdf/utils.py b/wkhtmltopdf/utils.py
index bfec068..94af5de 100644
--- a/wkhtmltopdf/utils.py
+++ b/wkhtmltopdf/utils.py
@@ -134,18 +134,14 @@ class RenderedFile(object):
def __init__(self, template, context, request=None):
debug = getattr(settings, 'WKHTMLTOPDF_DEBUG', settings.DEBUG)
- try:
- self.temporary_file = render_to_temporary_file(
- template=template,
- context=context,
- request=request,
- prefix='wkhtmltopdf', suffix='.html',
- delete=(not debug)
- )
- self.filename = self.temporary_file.name
- except:
- # In case something fails, return an empty filename string.
- self.filename = ''
+ self.temporary_file = render_to_temporary_file(
+ template=template,
+ context=context,
+ request=request,
+ prefix='wkhtmltopdf', suffix='.html',
+ delete=(not debug)
+ )
+ self.filename = self.temporary_file.name
def __del__(self):
# Always close the temporary_file on object destruction.