From: Rodney Ewing Date: Wed, 14 Aug 2013 17:58:31 +0000 (-0700) Subject: use a tmp_pdf filename X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=e7672e5b48687f75c08c360ee86f71ec43566512;p=mediagoblin.git use a tmp_pdf filename --- diff --git a/mediagoblin/media_types/pdf/processing.py b/mediagoblin/media_types/pdf/processing.py index 8294fbe2..17a3246c 100644 --- a/mediagoblin/media_types/pdf/processing.py +++ b/mediagoblin/media_types/pdf/processing.py @@ -288,15 +288,17 @@ class CommonPdfProcessor(MediaProcessor): """ Store the pdf. If the file is not a pdf, make it a pdf """ + tmp_pdf = self.orig_filename + unoconv = where('unoconv') Popen(executable=unoconv, args=[unoconv, '-v', '-f', 'pdf', self.orig_filename]).wait() - if not os.path.exists(self.pdf_filename): + if not os.path.exists(tmp_pdf): _log.debug('unoconv failed to convert file to pdf') raise BadMediaFail() - store_public(self.entry, 'pdf', self.pdf_filename, + store_public(self.entry, 'pdf', tmp_pdf, self.name_builder.fill('{basename}.pdf')) return self.workbench.local_file(