fix pdf urls

This commit is contained in:
j 2014-01-17 08:49:15 +00:00
parent f52daaacbd
commit 49d1b7860d

View file

@ -395,6 +395,7 @@ def pdf_viewer(request, id):
return render_to_json_response(response) return render_to_json_response(response)
def pdf(request, id): def pdf(request, id):
id = id.replace('_', ' ').replace('\t', '_')
text = get_text_or_404_json(id) text = get_text_or_404_json(id)
if text.type == 'pdf' and text.file and not text.uploading: if text.type == 'pdf' and text.file and not text.uploading:
return HttpFileResponse(text.file.path, content_type='application/pdf') return HttpFileResponse(text.file.path, content_type='application/pdf')