Don't set batch input file on creation, if no file exists
This commit is contained in:
parent
e1384c2ab1
commit
3bcec30a4c
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue