Skip to content
Snippets Groups Projects
Commit 6756f97d authored by Calen Pennington's avatar Calen Pennington
Browse files

Limit schedule resolvers to active schedules

parent fabad1de
No related branches found
No related tags found
No related merge requests found
......@@ -1760,7 +1760,7 @@ class CourseEnrollment(models.Model):
return None
try:
if not self.schedule:
if not self.schedule or not self.schedule.active:
return None
log.debug(
......
......@@ -123,10 +123,12 @@ class BinnedSchedulesBaseResolver(PrefixedDebugLoggerMixin, RecipientResolver):
'enrollment__course',
).filter(
Q(enrollment__course__end__isnull=True) | Q(
enrollment__course__end__gte=self.current_datetime),
enrollment__course__end__gte=self.current_datetime
),
self.experience_filter,
enrollment__user__in=users,
enrollment__is_active=True,
active=True,
**schedule_day_equals_target_day_filter
).order_by(order_by)
......
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