diff --git a/cms/djangoapps/contentstore/rest_api/v0/views/course_optimizer.py b/cms/djangoapps/contentstore/rest_api/v0/views/course_optimizer.py index abbc9c2e87cb..82e43d629a87 100644 --- a/cms/djangoapps/contentstore/rest_api/v0/views/course_optimizer.py +++ b/cms/djangoapps/contentstore/rest_api/v0/views/course_optimizer.py @@ -183,44 +183,9 @@ def get(self, request: Request, course_id: str): # Wasn't JSON, just use the value as a string pass - # print('DTO') - # print(broken_links_dto) - - # mock dto for testing - # broken_links_dto = { - # 'sections': [ - # { - # 'id': 'sectid', - # 'displayName': 'sectname', - # 'subsections': [ - # { - # 'id': 'subid', - # 'displayName': 'subname', - # 'units': [ - # { - # 'id': 'unitid', - # 'displayName': 'unitname', - # 'blocks': [ - # { - # 'id': 'blockid', - # 'displayName': 'blockname', - # 'url': 'blockurl', - # 'brokenLinks': [ - # 'link1', - # 'link2', - # ], - # }, - # ], - # } - # ] - # } - # ] - # } - # ] - # } data = { 'LinkCheckStatus': status, - 'LinkCheckCreatedAt': created_at, + **({'LinkCheckCreatedAt': created_at} if created_at else {}), **({'LinkCheckOutput': broken_links_dto} if broken_links_dto else {}), **({'LinkCheckError': error} if error else {}) }