From 854583d98d568a9e590d53e78291876e72d7f8e1 Mon Sep 17 00:00:00 2001 From: "daniyal.farman" Date: Tue, 28 Nov 2023 22:38:57 +0500 Subject: [PATCH 1/9] testing --- course_discovery/apps/course_metadata/data_loaders/api.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/course_discovery/apps/course_metadata/data_loaders/api.py b/course_discovery/apps/course_metadata/data_loaders/api.py index 6e9675e9ba..46b607fc3f 100644 --- a/course_discovery/apps/course_metadata/data_loaders/api.py +++ b/course_discovery/apps/course_metadata/data_loaders/api.py @@ -148,6 +148,7 @@ def get_course_run(self, body): """ course_run_key = body['id'] run = CourseRun.objects.filter_drafts(key__iexact=course_run_key).first() + logger.info('Invite Only Flag in get_course_run {}'.format(run.invite_only)) if not run: return None, None elif run.draft: @@ -187,6 +188,7 @@ def create_course_run(self, course, body): # Start with draft version and then make official (since our utility functions expect that flow) defaults['course'] = course.draft_version draft_run = CourseRun.objects.create(**defaults, draft=True) + logger.info('Invite Only Flag in draft_run {}'.format(draft_run.invite_only)) return draft_run.update_or_create_official_version(notify_services=False) else: return CourseRun.objects.create(**defaults) From fbf378a8e095b4455d9444e8c454818c2f088925 Mon Sep 17 00:00:00 2001 From: "daniyal.farman" Date: Wed, 29 Nov 2023 11:06:11 +0500 Subject: [PATCH 2/9] testing --- course_discovery/apps/course_metadata/data_loaders/api.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/course_discovery/apps/course_metadata/data_loaders/api.py b/course_discovery/apps/course_metadata/data_loaders/api.py index 46b607fc3f..78ca17ddca 100644 --- a/course_discovery/apps/course_metadata/data_loaders/api.py +++ b/course_discovery/apps/course_metadata/data_loaders/api.py @@ -120,6 +120,8 @@ def _process_response(self, response): try: body = self.clean_strings(body) official_run, draft_run = self.get_course_run(body) + for key, value in body.items(): + logger.info('I am Body Values {}: {}'.format(key, value)) if official_run or draft_run: self.update_course_run(official_run, draft_run, body) if not self.partner.uses_publisher: From fb34143e0c7b354247003d87e86f1ecc096c5009 Mon Sep 17 00:00:00 2001 From: "daniyal.farman" Date: Wed, 29 Nov 2023 12:25:47 +0500 Subject: [PATCH 3/9] testing --- course_discovery/apps/course_metadata/data_loaders/api.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/course_discovery/apps/course_metadata/data_loaders/api.py b/course_discovery/apps/course_metadata/data_loaders/api.py index 78ca17ddca..391ceff3f3 100644 --- a/course_discovery/apps/course_metadata/data_loaders/api.py +++ b/course_discovery/apps/course_metadata/data_loaders/api.py @@ -113,6 +113,10 @@ def _make_request(self, page): def _process_response(self, response): results = response['results'] logger.info('Retrieved %d course runs...', len(results)) + logger.info('I am getting called daniyal/EDLY6132') + + for key, value in results.items(): + logger.info('I am Body Values {}: {}'.format(key, value)) for body in results: course_run_id = body['id'] From 920819f312dda1e3b77c20c7ba7202e6f730e774 Mon Sep 17 00:00:00 2001 From: "daniyal.farman" Date: Wed, 29 Nov 2023 12:39:09 +0500 Subject: [PATCH 4/9] testing --- course_discovery/apps/course_metadata/data_loaders/api.py | 1 + 1 file changed, 1 insertion(+) diff --git a/course_discovery/apps/course_metadata/data_loaders/api.py b/course_discovery/apps/course_metadata/data_loaders/api.py index 391ceff3f3..afa47fc544 100644 --- a/course_discovery/apps/course_metadata/data_loaders/api.py +++ b/course_discovery/apps/course_metadata/data_loaders/api.py @@ -275,6 +275,7 @@ def format_course_run_data(self, body, course=None): 'video': self.get_courserun_video(body), 'status': CourseRunStatus.Unpublished, 'mobile_available': body.get('mobile_available') or False, + 'invite_only': body.get('invite_only') or False }) if course: From 464c1c952b695eefae4294c434b2e07c2265806e Mon Sep 17 00:00:00 2001 From: "daniyal.farman" Date: Wed, 29 Nov 2023 13:03:04 +0500 Subject: [PATCH 5/9] testing --- course_discovery/apps/course_metadata/data_loaders/api.py | 1 + 1 file changed, 1 insertion(+) diff --git a/course_discovery/apps/course_metadata/data_loaders/api.py b/course_discovery/apps/course_metadata/data_loaders/api.py index afa47fc544..06a6f77b78 100644 --- a/course_discovery/apps/course_metadata/data_loaders/api.py +++ b/course_discovery/apps/course_metadata/data_loaders/api.py @@ -114,6 +114,7 @@ def _process_response(self, response): results = response['results'] logger.info('Retrieved %d course runs...', len(results)) logger.info('I am getting called daniyal/EDLY6132') + logger.error('I am error daniyal/EDLY6132') for key, value in results.items(): logger.info('I am Body Values {}: {}'.format(key, value)) From 7c32d2c8f565685e376f750a66641a0dc4a68df4 Mon Sep 17 00:00:00 2001 From: "daniyal.farman" Date: Wed, 29 Nov 2023 16:34:07 +0500 Subject: [PATCH 6/9] testing --- course_discovery/apps/edly_discovery_app/tasks.py | 1 + 1 file changed, 1 insertion(+) diff --git a/course_discovery/apps/edly_discovery_app/tasks.py b/course_discovery/apps/edly_discovery_app/tasks.py index da724687dd..4580794d95 100644 --- a/course_discovery/apps/edly_discovery_app/tasks.py +++ b/course_discovery/apps/edly_discovery_app/tasks.py @@ -26,6 +26,7 @@ def run_dataloader(partner, course_id, service): dataloader, api_url = pipeline.get(service) LOGGER.info('Executing Loader [{}]'.format(api_url)) + LOGGER.info('Daniyal branch daniyal/EDLY6132') dataloader( partner=partner, From 960fd365af1a19a612aea3b0adbe5c87523c9b47 Mon Sep 17 00:00:00 2001 From: "daniyal.farman" Date: Thu, 7 Dec 2023 20:36:03 +0500 Subject: [PATCH 7/9] testing --- course_discovery/apps/course_metadata/data_loaders/api.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/course_discovery/apps/course_metadata/data_loaders/api.py b/course_discovery/apps/course_metadata/data_loaders/api.py index 06a6f77b78..5f84fb4525 100644 --- a/course_discovery/apps/course_metadata/data_loaders/api.py +++ b/course_discovery/apps/course_metadata/data_loaders/api.py @@ -116,9 +116,6 @@ def _process_response(self, response): logger.info('I am getting called daniyal/EDLY6132') logger.error('I am error daniyal/EDLY6132') - for key, value in results.items(): - logger.info('I am Body Values {}: {}'.format(key, value)) - for body in results: course_run_id = body['id'] From 59c38521fe914ee4d01d6670306cac94877e18af Mon Sep 17 00:00:00 2001 From: "daniyal.farman" Date: Fri, 8 Dec 2023 10:28:19 +0500 Subject: [PATCH 8/9] testing --- course_discovery/apps/course_metadata/data_loaders/api.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/course_discovery/apps/course_metadata/data_loaders/api.py b/course_discovery/apps/course_metadata/data_loaders/api.py index 5f84fb4525..d9116312be 100644 --- a/course_discovery/apps/course_metadata/data_loaders/api.py +++ b/course_discovery/apps/course_metadata/data_loaders/api.py @@ -122,8 +122,7 @@ def _process_response(self, response): try: body = self.clean_strings(body) official_run, draft_run = self.get_course_run(body) - for key, value in body.items(): - logger.info('I am Body Values {}: {}'.format(key, value)) + logger.info("invite flag {}".format(body.get('invite_only', 'No Flag Value'))) if official_run or draft_run: self.update_course_run(official_run, draft_run, body) if not self.partner.uses_publisher: @@ -273,7 +272,6 @@ def format_course_run_data(self, body, course=None): 'video': self.get_courserun_video(body), 'status': CourseRunStatus.Unpublished, 'mobile_available': body.get('mobile_available') or False, - 'invite_only': body.get('invite_only') or False }) if course: From 52193814329748c67dcbb81cecfe4e5a7c392003 Mon Sep 17 00:00:00 2001 From: "daniyal.farman" Date: Sun, 10 Dec 2023 13:46:57 +0500 Subject: [PATCH 9/9] testing --- course_discovery/apps/course_metadata/data_loaders/api.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/course_discovery/apps/course_metadata/data_loaders/api.py b/course_discovery/apps/course_metadata/data_loaders/api.py index d9116312be..80db794e89 100644 --- a/course_discovery/apps/course_metadata/data_loaders/api.py +++ b/course_discovery/apps/course_metadata/data_loaders/api.py @@ -240,12 +240,14 @@ def _update_verified_deadline_for_course_run(self, course_run): seat.save() def _update_instance(self, instance, validated_data, **kwargs): + logger.info('Instance {}'.format(instance)) if not instance: return updated = False for attr, value in validated_data.items(): + logger.info('Attr with Value {} {}'.format(attr, value)) if getattr(instance, attr) != value: setattr(instance, attr, value) updated = True