From 80e12af963d146c26d9def4bbc6bd48019c4f744 Mon Sep 17 00:00:00 2001 From: Awais Jibran Date: Mon, 20 Dec 2021 18:26:10 +0500 Subject: [PATCH] refactor: Adding some debug logs. (#29639) --- lms/djangoapps/courseware/courses.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lms/djangoapps/courseware/courses.py b/lms/djangoapps/courseware/courses.py index 89fa7c0596..9d7575e007 100644 --- a/lms/djangoapps/courseware/courses.py +++ b/lms/djangoapps/courseware/courses.py @@ -129,8 +129,16 @@ def get_course_overview_with_access(user, action, course_key, check_if_enrolled= try: course_overview = CourseOverview.get_from_id(course_key) except CourseOverview.DoesNotExist: + log.exception(f'Failed to retrieve course from courseoverview."{course_key}"') raise Http404("Course not found.") # lint-amnesty, pylint: disable=raise-missing-from + + course_under_investigation = str(course_key) == 'course-v1:UQx+ABLE301x+1T2022' + if course_under_investigation: + log.info('[TNL_9420] Course overview found, Checking course access.') check_course_access_with_redirect(course_overview, user, action, check_if_enrolled) + if course_under_investigation: + log.info('[TNL_9420] Course access granted') + return course_overview @@ -233,6 +241,9 @@ def check_course_access_with_redirect(course, user, action, check_if_enrolled=Fa # Deliberately return a non-specific error message to avoid # leaking info about access control settings + log.exception( + f'[TNL_9420] Failed to grant course access for "{course.id}", {access_response.to_json()}' + ) raise CoursewareAccessException(access_response)