Bug fix.
File can already exist if there was a previous problem running the script
This commit is contained in:
parent
02de382b8b
commit
c335390025
|
@ -32,6 +32,10 @@ class GetZippedFiles(Script):
|
||||||
else:
|
else:
|
||||||
zip_filename = 'attachments.zip'
|
zip_filename = 'attachments.zip'
|
||||||
|
|
||||||
|
# Delete the temporary zipfile if it already exist
|
||||||
|
if os.path.exists(zip_filename):
|
||||||
|
os.remove(zip_filename)
|
||||||
|
|
||||||
file_ids = kwargs['file_ids']
|
file_ids = kwargs['file_ids']
|
||||||
files = session.query(FileModel).filter(FileModel.id.in_(file_ids)).all()
|
files = session.query(FileModel).filter(FileModel.id.in_(file_ids)).all()
|
||||||
if files:
|
if files:
|
||||||
|
|
Loading…
Reference in New Issue