From efdbbcbc72cdb04d665d423ebe0dae01b42785f8 Mon Sep 17 00:00:00 2001 From: Dan Date: Wed, 30 Dec 2020 14:51:51 -0500 Subject: [PATCH] StudyInfo sometimes returns arrays of items, each item in the array should be coverted to a Box dictionary if possible. --- crc/scripts/study_info.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crc/scripts/study_info.py b/crc/scripts/study_info.py index c4b1bffd..a5378900 100644 --- a/crc/scripts/study_info.py +++ b/crc/scripts/study_info.py @@ -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