Skip to content
Snippets Groups Projects
Commit 901bb77d authored by Kevin S. Hahn's avatar Kevin S. Hahn
Browse files

stops attachments from overwriting each other

- attachment must have unique filename+extention
- attachments can have same (type, kind, state)
parent 76a45fa4
No related branches found
No related tags found
No related merge requests found
......@@ -58,6 +58,8 @@ def insert_file(dbc, _id, file_info, filepath, digest, data_path, quarantine_pat
'state': file_info.get('state'),
}},
}
if flavor == 'attachments':
file_spec[flavor]['$elemMatch'].update({'name': file_info.get('name'), 'ext': file_info.get('ext')})
container_path = os.path.join(data_path, str(_id)[-3:] + '/' + str(_id))
if not os.path.exists(container_path):
os.makedirs(container_path)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment