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)
|
filename = getattr(batch, 'filename', None)
|
||||||
if filename:
|
if filename:
|
||||||
path = os.path.join(self.upload_dir, filename)
|
path = os.path.join(self.upload_dir, filename)
|
||||||
self.handler.set_input_file(batch, path)
|
if os.path.exists(path):
|
||||||
os.remove(path)
|
self.handler.set_input_file(batch, path)
|
||||||
|
os.remove(path)
|
||||||
|
|
||||||
# return this object to replace the original
|
# return this object to replace the original
|
||||||
return batch
|
return batch
|
||||||
|
|
Loading…
Reference in a new issue