From 60c94ea8ca76cf86ccde7dc1d41d5432b1e0c4a3 Mon Sep 17 00:00:00 2001 From: muhammad-ammar Date: Thu, 9 Jun 2022 16:50:11 +0500 Subject: [PATCH] chore: add more logs in send_segment_events_for_failed_learners command --- .../commands/send_segment_events_for_failed_learners.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lms/djangoapps/grades/management/commands/send_segment_events_for_failed_learners.py b/lms/djangoapps/grades/management/commands/send_segment_events_for_failed_learners.py index 3c1a11ac0b..c586360072 100644 --- a/lms/djangoapps/grades/management/commands/send_segment_events_for_failed_learners.py +++ b/lms/djangoapps/grades/management/commands/send_segment_events_for_failed_learners.py @@ -53,7 +53,10 @@ class Command(BaseCommand): but we are adding grace period of 1 day to mitigate any edge cases due to last minute grade override. """ thirty_one_days_ago = timezone.now().date() - timedelta(days=31) - return CourseOverview.objects.exclude(end__isnull=True).filter(end__date=thirty_one_days_ago) + courses = CourseOverview.objects.exclude(end__isnull=True).filter(end__date=thirty_one_days_ago) + thirty_one_days_ago_ended_course_keys = [str(course) for course in courses.values_list('id', flat=True)] + log.info(f"Found {thirty_one_days_ago_ended_course_keys} courses that were ended on [{thirty_one_days_ago}]") + return courses def get_course_failed_user_ids(self, course): """