Fix error accidental delete of staging file on preview
This commit is contained in:
@@ -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')))
|
||||
|
||||
Reference in New Issue
Block a user