Commit d68d8e80 authored by dario's avatar dario

web/views: fix broken pipe on interrupted download

parent 7fbaab35
......@@ -152,9 +152,13 @@ def send_pdf_file(request, pdffile):
## this uses a => b == !a v b, so what it wants to say is
## "if meta['internal_net_only'], _then_ we need is_internal to be true"
if not meta.get('internal_net_only', False) or is_internal:
return Response(wrap_file(request.environ, file(os.path.join(config.pdfdir, pdffile))),
mimetype='application/pdf',
direct_passthrough=True)
try:
return Response(wrap_file(request.environ, file(os.path.join(config.pdfdir, pdffile))),
mimetype='application/pdf',
direct_passthrough=True)
except IOError:
## broken pipe/client quit halfway through
pass
else:
return render_template('error.xml',
error_hdr='Error',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment