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

fixes file/attachment file_spec to use flavor type

- instead of string 'flavor'
- dict() syntax does not allow using variable as keys, {} does
parent 2e72e304
No related branches found
No related tags found
No related merge requests found
......@@ -50,14 +50,14 @@ def insert_file(dbc, _id, file_info, filepath, digest, data_path, quarantine_pat
)
filename = dataset.nims_file_name + dataset.nims_file_ext
else:
file_spec = dict(
_id=_id,
flavor={'$elemMatch': {
file_spec = {
'_id': _id,
flavor: {'$elemMatch': {
'type': file_info.get('type'),
'kinds': file_info.get('kinds'),
'state': file_info.get('state'),
}},
)
}
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