Skip to content
Snippets Groups Projects
Commit b5399282 authored by Megan Henning's avatar Megan Henning Committed by GitHub
Browse files

Merge pull request #369 from scitran/propagation-bug

Fix propagation bug related to missing s
parents 9b2c618c dd636b58
No related branches found
No related tags found
No related merge requests found
......@@ -107,7 +107,7 @@ def propagate_changes(cont_name, _id, query, update):
config.db.acquisitions.update_many(acquisition_q, update)
elif cont_name == 'sessions':
query['sessions'] = _id
query['session'] = _id
config.db.acquisitions.update_many(query, update)
else:
raise ValueError('changes can only be propagated from group, project or session level')
......
......@@ -61,18 +61,18 @@ def test_public_propagation_from_project(with_hierarchy, data_builder, api_as_ad
"""
data = with_hierarchy
payload = json.dumps({'public': True})
payload = json.dumps({'public': False})
r = api_as_admin.put('/projects/' + data.project, data=payload)
assert r.ok
r = api_as_admin.get('/projects/' + data.project)
assert r.ok and json.loads(r.content)['public']
assert r.ok and not json.loads(r.content)['public']
r = api_as_admin.get('/sessions/' + data.session)
assert r.ok and json.loads(r.content)['public']
assert r.ok and not json.loads(r.content)['public']
r = api_as_admin.get('/acquisitions/' + data.acquisition)
assert r.ok and json.loads(r.content)['public']
assert r.ok and not json.loads(r.content)['public']
def test_public_and_archived_propagation_from_project(with_hierarchy, data_builder, api_as_admin):
"""
......@@ -104,15 +104,15 @@ def test_public_propagation_from_session(with_hierarchy, data_builder, api_as_ad
"""
data = with_hierarchy
payload = json.dumps({'public': True})
payload = json.dumps({'archived': True})
r = api_as_admin.put('/sessions/' + data.session, data=payload)
assert r.ok
r = api_as_admin.get('/sessions/' + data.session)
assert r.ok and json.loads(r.content)['public']
assert r.ok and json.loads(r.content)['archived']
r = api_as_admin.get('/acquisitions/' + data.acquisition)
assert r.ok and json.loads(r.content)['public']
assert r.ok and json.loads(r.content)['archived']
def test_set_public_acquisition(with_hierarchy, data_builder, api_as_admin):
"""
......
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