Fix error accidental delete of staging file on preview

This commit is contained in:
Roberto Rosario
2011-02-15 15:27:34 -04:00
parent 52c2f7c1d4
commit c8d5e26b4c
2 changed files with 4 additions and 3 deletions

View File

@@ -521,7 +521,7 @@ def document_download(request, document_id):
def staging_file_preview(request, staging_file_id):
try:
filepath = StagingFile.get(staging_file_id).filepath
output_file = convert(filepath, STAGING_FILES_PREVIEW_SIZE)
output_file = convert(filepath, STAGING_FILES_PREVIEW_SIZE, cleanup=False)
return serve_file(request, File(file=open(output_file, 'r')))
except Exception, e:
return serve_file(request, File(file=open('%simages/1297211435_error.png' % settings.MEDIA_ROOT, 'r')))