-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added logs while importing course #7
base: master
Are you sure you want to change the base?
Changes from 5 commits
70010b8
f06453a
4f7eb6a
b4f312a
1591b5b
b023a33
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -381,7 +381,8 @@ def try_load_course(self, course_dir, course_ids=None, target_course_id=None): | |
raise exc | ||
finally: | ||
if course_descriptor is None: | ||
pass | ||
if str(target_course_id) == "course-v1:ArbiX+CS101+2014_T3": | ||
logging.info(f"Investigation Log: {target_course_id} : Course Descriptor is None") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this shouldn't be part of the
|
||
elif isinstance(course_descriptor, ErrorBlock): | ||
# Didn't load course. Instead, save the errors elsewhere. | ||
self.errored_courses[course_dir] = errorlog | ||
|
@@ -487,6 +488,8 @@ def load_course(self, course_dir, course_ids, tracker, target_course_id=None): | |
course_id = self.get_id(org, course, url_name) | ||
|
||
if course_ids is not None and course_id not in course_ids: | ||
if str(target_course_id) == "course-v1:ArbiX+CS101+2014_T3": | ||
logging.info(f"Investigation Log: {target_course_id} : Course ID not in Course IDs (List)") | ||
return None | ||
|
||
def get_policy(usage_id): | ||
|
@@ -522,6 +525,8 @@ def get_policy(usage_id): | |
course_descriptor = system.process_xml(etree.tostring(course_data, encoding='unicode')) | ||
# If we fail to load the course, then skip the rest of the loading steps | ||
if isinstance(course_descriptor, ErrorBlock): | ||
if str(target_course_id) == "course-v1:ArbiX+CS101+2014_T3": | ||
logging.info(f"Investigation Log: {target_course_id} : Course Descriptor is instance of ErrorBlock") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see single quotes here in this file, please use single quotes here too. |
||
return course_descriptor | ||
|
||
self.content_importers(system, course_descriptor, course_dir, url_name) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why was this changed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added "as e" after Exception to print it. Awais bhai told me LOGGER.Exception prints exception. Restored old code.