From 22e510d69b59b1139ecb046a7370c0b2f7e59a6d Mon Sep 17 00:00:00 2001 From: Mohammad Ahtasham ul Hassan <60315450+aht007@users.noreply.github.com> Date: Wed, 8 Jun 2022 20:31:52 +0500 Subject: [PATCH] fix: remove logging (#30559) --- lms/djangoapps/courseware/access_utils.py | 4 ---- lms/djangoapps/courseware/courses.py | 7 ------- .../djangoapps/content/block_structure/block_structure.py | 3 +-- 3 files changed, 1 insertion(+), 13 deletions(-) diff --git a/lms/djangoapps/courseware/access_utils.py b/lms/djangoapps/courseware/access_utils.py index 2e7c2fb330..9fa9c76203 100644 --- a/lms/djangoapps/courseware/access_utils.py +++ b/lms/djangoapps/courseware/access_utils.py @@ -88,11 +88,7 @@ def check_start_date(user, days_early_for_beta, start, course_key, display_error now = datetime.now(UTC) effective_start = adjust_start_date(user, days_early_for_beta, start, course_key) - # Todo: This log statement is added for temporary use only - log.info('Python-dateutil logs: Comparing current date with effective start date') should_grant_access = now > effective_start - # Todo: This log statement is added for temporary use only - log.info('Python-dateutil logs: Successfully compared current date with effective start date') if should_grant_access: return ACCESS_GRANTED diff --git a/lms/djangoapps/courseware/courses.py b/lms/djangoapps/courseware/courses.py index 93c58f20aa..bf14f7e2fc 100644 --- a/lms/djangoapps/courseware/courses.py +++ b/lms/djangoapps/courseware/courses.py @@ -558,10 +558,6 @@ def get_course_assignments(course_key, user, include_access=False): # lint-amne if not user.id: return [] - # Todo: This log statement is added for temporary use only - log.info('Python-dateutil logs: Trying to get course assignment for user: {} of course: {}'.format( - user.id, course_key)) - store = modulestore() course_usage_key = store.make_course_usage_key(course_key) block_data = get_course_blocks(user, course_usage_key, allow_start_dates_in_future=True, include_completion=True) @@ -663,9 +659,6 @@ def get_course_assignments(course_key, user, include_access=False): # lint-amne _("Open Response Assessment due dates are set by your instructor and can't be shifted."), first_component_block_id, )) - # Todo: This log statement is added for temporary use only - log.info('Python-dateutil logs: Successfully got course assignments for user: {} of course: {}'.format( - user.id, course_key)) return assignments diff --git a/openedx/core/djangoapps/content/block_structure/block_structure.py b/openedx/core/djangoapps/content/block_structure/block_structure.py index 17e06546d4..ba9990bb79 100644 --- a/openedx/core/djangoapps/content/block_structure/block_structure.py +++ b/openedx/core/djangoapps/content/block_structure/block_structure.py @@ -777,8 +777,7 @@ class BlockStructureBlockData(BlockStructure): """ if isinstance(field, datetime): if isinstance(field.tzinfo, tzlocal) and not hasattr(field.tzinfo, '_hasdst'): - # Todo: This log statement is added for temporary use only - logger.info('Python-dateutil logs: Making datetime field compatible to python-dateutil package') + return datetime( year=field.year, month=field.month, day=field.day, hour=field.hour, minute=field.minute, second=field.second,