Merge pull request #215 from sartography/dev
Covert arrays of dicts to arrays of Box in the script task.
This commit is contained in:
commit
404ff5a586
|
@ -407,9 +407,11 @@ Returns information specific to the protocol.
|
||||||
retval = StudyService().get_documents_status(study_id)
|
retval = StudyService().get_documents_status(study_id)
|
||||||
if cmd == 'protocol':
|
if cmd == 'protocol':
|
||||||
retval = StudyService().get_protocol(study_id)
|
retval = StudyService().get_protocol(study_id)
|
||||||
|
if isinstance(retval, list):
|
||||||
|
retval = [Box(item) for item in retval]
|
||||||
if isinstance(retval,dict) and prefix is not None:
|
if isinstance(retval,dict) and prefix is not None:
|
||||||
return Box({x:retval[x] for x in retval.keys() if x[:len(prefix)] == prefix})
|
return Box({x:retval[x] for x in retval.keys() if x[:len(prefix)] == prefix})
|
||||||
elif isinstance(retval,dict):
|
elif isinstance(retval,dict) :
|
||||||
return Box(retval)
|
return Box(retval)
|
||||||
else:
|
else:
|
||||||
return retval
|
return retval
|
||||||
|
|
Loading…
Reference in New Issue