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

Fix bug loading jobs no acqusitions

parent f436f03c
No related branches found
No related tags found
No related merge requests found
......@@ -50,6 +50,8 @@ class ContainerStorage(object):
def get_container(self, _id, projection=None, get_children=False):
cont = self.get_el(_id, projection=projection)
if cont is None:
raise APINotFoundException('Could not find {} {}'.format(self.cont_name, _id))
if get_children:
children = self.get_children(_id, projection=projection)
cont[CHILD_MAP[self.cont_name]] = children
......
......@@ -223,17 +223,20 @@ class ContainerHandler(base.RequestHandler):
}
]
"""
self.config = self.container_handler_configurations[cont_name]
self.storage = self.config['storage']
if cont_name != 'sessions':
self.abort(400, 'Can only request jobs at the session level.')
cont = self._get_container(cid, projection={'permissions': 0}, get_children=True)
permchecker = self._get_permchecker(cont)
permchecker(noop)('GET', cid)
children = cont.get('acquisitions')
if not children:
return {}
id_array = [str(c['_id']) for c in children]
cont_array = [containerutil.ContainerReference('acquisition', cid) for cid in id_array]
......
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