Minor cleanup for readability.

This commit is contained in:
mike cullerton 2021-11-08 10:13:07 -05:00
parent ed5689c1b9
commit b193f56f35
2 changed files with 1 additions and 5 deletions

View File

@ -31,13 +31,10 @@ class ProtocolBuilderService(object):
if not isinstance(user_id, str):
raise ApiError("protocol_builder_error", "This user id is invalid: " + str(user_id))
url = ProtocolBuilderService.STUDY_URL % user_id
logging.info(f'get_studies: url: {url}')
response = requests.get(url)
if response.ok and response.text:
logging.info(f'get_studies: response.text: {response.text}')
try:
pb_studies = ProtocolBuilderStudySchema(many=True).loads(response.text)
logging.info(f'get_studies: pb_studies: {pb_studies}')
return pb_studies
except JSONDecodeError as err:
raise ApiError("protocol_builder_error",

View File

@ -37,11 +37,10 @@ class StudyService(object):
@staticmethod
def _is_valid_study(study_id):
study_info = None
study_details = ProtocolBuilderService().get_study_details(study_id)
if len(study_details) > 0:
study_info = study_details[0]
else:
study_info = None
# 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`
if isinstance(study_info, dict) and 'REVIEW_TYPE' in study_info.keys() and study_info['REVIEW_TYPE'] in [2, 3, 23, 24]: