Skip to content
Snippets Groups Projects
Unverified Commit c1130e60 authored by Jeff LaJoie's avatar Jeff LaJoie Committed by GitHub
Browse files

Merge pull request #23944 from edx/jlajoie/course-update-command-fixes

Changes type of objects that get serialized, removes a problematic log statement
parents c0999328 c8726995
No related branches found
Tags release-2020-12-18-12.59
No related merge requests found
......@@ -434,11 +434,6 @@ class CourseNextSectionUpdate(PrefixedDebugLoggerMixin, RecipientResolver):
def send(self):
schedules = self.get_schedules()
LOG.info(
u'Found {} emails to send for course-key: {}'.format(
len(schedules), self.course_key
)
)
for (user, language, context, is_self_paced) in schedules:
msg_type = CourseUpdate() if is_self_paced else InstructorLedCourseUpdate()
msg_type.personalize(
......
......@@ -213,17 +213,17 @@ class ScheduleCourseNextSectionUpdate(ScheduleMessageBaseTask):
@classmethod
def enqueue(cls, site, current_date, day_offset, override_recipient_email=None):
target_date = (current_date - datetime.timedelta(days=day_offset)).date()
target_datetime = (current_date - datetime.timedelta(days=day_offset))
if not cls.is_enqueue_enabled(site):
cls.log_info(u'Message queuing disabled for site %s', site.domain)
return
cls.log_info(u'Target date = %s', target_date.isoformat())
cls.log_info(u'Target date = %s', target_datetime.date().isoformat())
for course_key in CourseOverview.get_all_course_keys():
task_args = (
site.id,
serialize(target_date),
serialize(target_datetime), # Need to leave as a datetime for serialization purposes here
course_key,
override_recipient_email,
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment