Merge pull request #215 from sartography/dev

Covert arrays of dicts to arrays of Box in the script task.
This commit is contained in:
Dan Funk 2020-12-30 15:09:23 -05:00 committed by GitHub
commit 404ff5a586
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -407,9 +407,11 @@ Returns information specific to the protocol.
retval = StudyService().get_documents_status(study_id)
if cmd == 'protocol':
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:
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)
else:
return retval