Don't set batch input file on creation, if no file exists

This commit is contained in:
Lance Edgar 2017-09-23 13:32:12 -05:00
parent e1384c2ab1
commit 3bcec30a4c

View file

@ -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