use a tmp_pdf filename
authorRodney Ewing <ewing.rj@gmail.com>
Wed, 14 Aug 2013 17:58:31 +0000 (10:58 -0700)
committerRodney Ewing <ewing.rj@gmail.com>
Fri, 16 Aug 2013 22:30:21 +0000 (15:30 -0700)
mediagoblin/media_types/pdf/processing.py

index 8294fbe21335abeedee772a463b6c9b9c93156f3..17a3246c92be353e0870b471af2d875afe03dd89 100644 (file)
@@ -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(