From 3bcec30a4c0d016c99920e14c3d93372a5da4001 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Sat, 23 Sep 2017 13:32:12 -0500 Subject: [PATCH] Don't set batch input file on creation, if no file exists --- tailbone/views/batch/core.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tailbone/views/batch/core.py b/tailbone/views/batch/core.py index 41098fb0..0ed72c6f 100644 --- a/tailbone/views/batch/core.py +++ b/tailbone/views/batch/core.py @@ -262,8 +262,9 @@ class BatchMasterView(MasterView): filename = getattr(batch, 'filename', None) if filename: path = os.path.join(self.upload_dir, filename) - self.handler.set_input_file(batch, path) - os.remove(path) + if os.path.exists(path): + self.handler.set_input_file(batch, path) + os.remove(path) # return this object to replace the original return batch