temp: removed previous logs and added new logs for course export (#31664)
Co-authored-by: adeel.tajamul <adeel.tajamul@arbisoft.com>
This commit is contained in:
committed by
GitHub
parent
a50ef12ad0
commit
54cd3c562a
@@ -676,6 +676,16 @@ def _deprecated_blocks_info(course_block, deprecated_block_types):
|
||||
return data
|
||||
|
||||
|
||||
def add_course_logs(course_key_string, course_like):
|
||||
"""
|
||||
Add logs for course export
|
||||
TODO: To be removed after export issue is resolved (INF-667)
|
||||
"""
|
||||
logging.info(f'{course_key_string} {course_like.url_name} {course_like.display_name}')
|
||||
for child in course_like.get_children():
|
||||
add_course_logs(course_key_string, child)
|
||||
|
||||
|
||||
@login_required
|
||||
@ensure_csrf_cookie
|
||||
def course_index(request, course_key):
|
||||
@@ -690,6 +700,11 @@ def course_index(request, course_key):
|
||||
course_block = get_course_and_check_access(course_key, request.user, depth=None)
|
||||
if not course_block:
|
||||
raise Http404
|
||||
# TODO: Remove function call after export issue is resolved (INF-667)
|
||||
try:
|
||||
add_course_logs(str(course_key), course_block)
|
||||
except: # pylint: disable=bare-except
|
||||
logging.info(f'{str(course_key)} Error traversing course')
|
||||
lms_link = get_lms_link_for_item(course_block.location)
|
||||
reindex_link = None
|
||||
if settings.FEATURES.get('ENABLE_COURSEWARE_INDEX', False):
|
||||
|
||||
@@ -101,16 +101,6 @@ def _export_drafts(modulestore, course_key, export_fs, xml_centric_course_key):
|
||||
draft_node.module.add_xml_to_node(node)
|
||||
|
||||
|
||||
def add_course_logs(course_key_string, course_like):
|
||||
"""
|
||||
Add logs for course export
|
||||
TODO: To be removed after export issue is resolved (INF-667)
|
||||
"""
|
||||
logging.info(f'{course_key_string} {course_like.url_name} {course_like.display_name}')
|
||||
for child in course_like.get_children():
|
||||
add_course_logs(course_key_string, child)
|
||||
|
||||
|
||||
class ExportManager:
|
||||
"""
|
||||
Manages XML exporting for courselike objects.
|
||||
@@ -171,9 +161,6 @@ class ExportManager:
|
||||
# export only the published content
|
||||
with self.modulestore.branch_setting(ModuleStoreEnum.Branch.published_only, self.courselike_key):
|
||||
courselike = self.get_courselike()
|
||||
# TODO: Remove function call after export issue is resolved (INF-667)
|
||||
add_course_logs(str(self.courselike_key), courselike)
|
||||
|
||||
export_fs = courselike.runtime.export_fs = fsm.makedir(self.target_dir, recreate=True)
|
||||
|
||||
# change all of the references inside the course to use the xml expected key type w/o version & branch
|
||||
|
||||
Reference in New Issue
Block a user