mirror of
https://github.com/sartography/cr-connect-workflow.git
synced 2025-02-23 21:28:32 +00:00
Minor cleanup for readability.
This commit is contained in:
parent
ed5689c1b9
commit
b193f56f35
@ -31,13 +31,10 @@ class ProtocolBuilderService(object):
|
|||||||
if not isinstance(user_id, str):
|
if not isinstance(user_id, str):
|
||||||
raise ApiError("protocol_builder_error", "This user id is invalid: " + str(user_id))
|
raise ApiError("protocol_builder_error", "This user id is invalid: " + str(user_id))
|
||||||
url = ProtocolBuilderService.STUDY_URL % user_id
|
url = ProtocolBuilderService.STUDY_URL % user_id
|
||||||
logging.info(f'get_studies: url: {url}')
|
|
||||||
response = requests.get(url)
|
response = requests.get(url)
|
||||||
if response.ok and response.text:
|
if response.ok and response.text:
|
||||||
logging.info(f'get_studies: response.text: {response.text}')
|
|
||||||
try:
|
try:
|
||||||
pb_studies = ProtocolBuilderStudySchema(many=True).loads(response.text)
|
pb_studies = ProtocolBuilderStudySchema(many=True).loads(response.text)
|
||||||
logging.info(f'get_studies: pb_studies: {pb_studies}')
|
|
||||||
return pb_studies
|
return pb_studies
|
||||||
except JSONDecodeError as err:
|
except JSONDecodeError as err:
|
||||||
raise ApiError("protocol_builder_error",
|
raise ApiError("protocol_builder_error",
|
||||||
|
@ -37,11 +37,10 @@ class StudyService(object):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _is_valid_study(study_id):
|
def _is_valid_study(study_id):
|
||||||
|
study_info = None
|
||||||
study_details = ProtocolBuilderService().get_study_details(study_id)
|
study_details = ProtocolBuilderService().get_study_details(study_id)
|
||||||
if len(study_details) > 0:
|
if len(study_details) > 0:
|
||||||
study_info = study_details[0]
|
study_info = study_details[0]
|
||||||
else:
|
|
||||||
study_info = None
|
|
||||||
# The review types 2, 3, 23, 24 correspond to review type names
|
# The review types 2, 3, 23, 24 correspond to review type names
|
||||||
# `Full Committee`, `Expedited`, `Non-UVA IRB Full Board`, and `Non-UVA IRB Expedited`
|
# `Full Committee`, `Expedited`, `Non-UVA IRB Full Board`, and `Non-UVA IRB Expedited`
|
||||||
if isinstance(study_info, dict) and 'REVIEW_TYPE' in study_info.keys() and study_info['REVIEW_TYPE'] in [2, 3, 23, 24]:
|
if isinstance(study_info, dict) and 'REVIEW_TYPE' in study_info.keys() and study_info['REVIEW_TYPE'] in [2, 3, 23, 24]:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user