Skip to content
Snippets Groups Projects
Commit 908088c0 authored by Harsha Kethineni's avatar Harsha Kethineni Committed by GitHub
Browse files

Merge pull request #926 from scitran/download-subject

Code is sent with subject and test doesn't filter out acquisition files
parents 4d963216 4a6142f6
No related branches found
Tags 1.0.70
No related merge requests found
......@@ -139,10 +139,12 @@ class Download(base.RequestHandler):
subject_prefixes = {}
for session in session_dict.itervalues():
if session.get('subject'):
code = session['subject'].get('code', 'unknown_subject')
# This is bad and we should try to combine these somehow,
# or at least make sure we get all the files
subject_dict[code] = session['subject']
subject = session.get('subject', {'code': 'unknown_subject'})
code = subject.get('code')
if code is None:
code = 'unknown_subject'
subject['code'] = code
subject_dict[code] = subject
for code, subject in subject_dict.iteritems():
subject_prefix = prefix + '/' + self._path_from_container(subject, used_subpaths, ids_of_paths, code)
......
......@@ -37,14 +37,10 @@ def test_download(data_builder, file_form, as_admin, api_db):
r = as_admin.post('/download', json={
'optional': False,
'filters': [{'tags': {
'-': ['minus'],
'+': ['plus']
'-': ['minus']
}}],
'nodes': [
{'level': 'project', '_id': project},
{'level': 'session', '_id': session},
{'level': 'acquisition', '_id': acquisition},
{'level': 'acquisition', '_id':acquisition2},
{'level': 'project', '_id': project},
]
})
assert r.ok
......
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