Skip to content

Commit

Permalink
Fix Content-Disposition header
Browse files Browse the repository at this point in the history
  • Loading branch information
jochenklar committed Mar 29, 2018
1 parent b91cce5 commit fa351db
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rdmo/core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@ def render_to_format(request, format, title, template_src, context):
else:
args = ['-V', 'geometry:margin=1in', '--pdf-engine=pdflatex']

content_disposition = 'filename=%s.%s' % (title, format)
content_disposition = 'filename="%s.%s"' % (title, format)
else:
args = []
content_disposition = 'attachment; filename=%s.%s' % (title, format)
content_disposition = 'attachment; filename="%s.%s"' % (title, format)

# create a temporary file
(tmp_fd, tmp_filename) = mkstemp('.' + format)
Expand All @@ -114,7 +114,7 @@ def render_to_format(request, format, title, template_src, context):

def render_to_csv(request, title, rows):
response = HttpResponse(content_type='text/csv')
response['Content-Disposition'] = 'attachment; filename=%s.csv' % title
response['Content-Disposition'] = 'attachment; filename="%s.csv"' % title

writer = csv.writer(response)

Expand Down

0 comments on commit fa351db

Please sign in to comment.