Jeff made a modification to the API endpoints so we can reduce the number of calls we need to make. Just mimicing that adjustment in our mock api.

This commit is contained in:
Dan 2022-03-17 19:54:49 -04:00
parent 0afce84180
commit 29be81126a

View File

@ -288,14 +288,20 @@ class CreatorStudySchema(ma.Schema):
model = Study model = Study
include_relationships = True include_relationships = True
load_instance = True load_instance = True
fields = ["STUDYID", "TITLE", "DATECREATED", "DATELASTMODIFIED"] fields = ["STUDYID", "TITLE", "DATECREATED", "DATELASTMODIFIED", "REVIEW_TYPE"]
DATECREATED = DATELASTMODIFIED = fields.Method("get_dates") DATECREATED = DATELASTMODIFIED = fields.Method("get_dates")
REVIEW_TYPE = fields.Method("get_review_type")
@staticmethod @staticmethod
def get_dates(obj): def get_dates(obj):
if obj is not None and hasattr(obj, "DATE_MODIFIED"): if obj is not None and hasattr(obj, "DATE_MODIFIED"):
return obj.DATE_MODIFIED return obj.DATE_MODIFIED
@staticmethod
def get_review_type(obj):
if obj is not None and hasattr(obj, "study_details"):
return obj.study_details.REVIEW_TYPE
class StudySchema(ma.Schema): class StudySchema(ma.Schema):
class Meta: class Meta: