Skip to content
Snippets Groups Projects
Unverified Commit fb416ba4 authored by edx-pipeline-bot's avatar edx-pipeline-bot Committed by GitHub
Browse files

Merge pull request #22979 from edx/private_to_public_561fb8c

Mergeback PR from private to public.
parents 0cb0867c 561fb8ca
Branches
Tags
No related merge requests found
......@@ -117,6 +117,7 @@ class BinnedSchedulesBaseResolver(PrefixedDebugLoggerMixin, RecipientResolver):
}
users = User.objects.filter(
courseenrollment__is_active=True,
is_active=True,
**schedule_day_equals_target_day_filter
).annotate(
id_mod=self.bin_num_for_user_id(F('id'))
......
......@@ -155,3 +155,15 @@ class TestCourseUpdateResolver(SchedulesResolverTestMixin, ModuleStoreTestCase):
resolver = self.create_resolver()
schedules = list(resolver.schedules_for_bin())
self.assertIn('optout', schedules[0][2]['unsubscribe_url'])
@override_waffle_flag(COURSE_UPDATE_WAFFLE_FLAG, True)
def test_get_schedules_with_target_date_by_bin_and_orgs_filter_inactive_users(self):
"""Tests that schedules of inactive users are excluded"""
resolver = self.create_resolver()
schedules = resolver.get_schedules_with_target_date_by_bin_and_orgs()
self.assertEqual(schedules.count(), 1)
self.user.is_active = False
self.user.save()
schedules = resolver.get_schedules_with_target_date_by_bin_and_orgs()
self.assertEqual(schedules.count(), 0)
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment