From 9779f3e96e91f66324de6bcddd55858b3f954947 Mon Sep 17 00:00:00 2001 From: Zaman Afzal Date: Tue, 14 Jan 2025 16:47:55 +0500 Subject: [PATCH] fix: Log all learner transmissions (#2313) --- CHANGELOG.rst | 4 ++++ enterprise/__init__.py | 2 +- integrated_channels/moodle/client.py | 26 +++++++++++++------------- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index c4fe189d06..c0701ae017 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -17,6 +17,10 @@ Unreleased ---------- * nothing unreleased +[5.6.1] +-------- +* fix: Log all learner transmission records. + [5.6.0] -------- * feat: Adds sorting support to enterprise-customer-members endpoint diff --git a/enterprise/__init__.py b/enterprise/__init__.py index 8422168fd8..701028e69a 100644 --- a/enterprise/__init__.py +++ b/enterprise/__init__.py @@ -2,4 +2,4 @@ Your project description goes here. """ -__version__ = "5.6.0" +__version__ = "5.6.1" diff --git a/integrated_channels/moodle/client.py b/integrated_channels/moodle/client.py index cd883e12a3..25b6cf5444 100644 --- a/integrated_channels/moodle/client.py +++ b/integrated_channels/moodle/client.py @@ -418,19 +418,19 @@ def _wrapped_create_course_completion(self, user_id, payload): headers = response.headers else: headers = None - if not status_code or not text or not headers: - LOGGER.info( - 'Learner Data Transmission' - f'for course={completion_data["courseID"]} with data ' - f'source: {module_name}, ' - f'activityid: {course_module_id}, ' - f'grades[0][studentid]: {moodle_user_id}, ' - f'grades[0][grade]: {completion_data["grade"] * self.enterprise_configuration.grade_scale} ' - f' with response: {response} ' - f'Status Code: {status_code}, ' - f'Text: {text}, ' - f'Headers: {headers}, ' - ) + + LOGGER.info( + 'Learner Data Transmission' + f'for course={completion_data["courseID"]} with data ' + f'source: {module_name}, ' + f'activityid: {course_module_id}, ' + f'grades[0][studentid]: {moodle_user_id}, ' + f'grades[0][grade]: {completion_data["grade"] * self.enterprise_configuration.grade_scale} ' + f' with response: {response} ' + f'Status Code: {status_code}, ' + f'Text: {text}, ' + f'Headers: {headers}, ' + ) return response