From aef53abce4f02e2abadbe9bc0ad901f38b5e159c Mon Sep 17 00:00:00 2001 From: Bryann Valderrama Date: Fri, 6 Dec 2024 13:12:02 -0500 Subject: [PATCH] feat: add schedule queryset request filter integration --- openedx/core/djangoapps/schedules/resolvers.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/openedx/core/djangoapps/schedules/resolvers.py b/openedx/core/djangoapps/schedules/resolvers.py index 5f769e6af299..7a966a575bec 100644 --- a/openedx/core/djangoapps/schedules/resolvers.py +++ b/openedx/core/djangoapps/schedules/resolvers.py @@ -14,6 +14,7 @@ from edx_ace.recipient import Recipient from edx_ace.recipient_resolver import RecipientResolver from edx_django_utils.monitoring import function_trace, set_custom_attribute +from openedx_filters.learning.filters import ScheduleQuerySetRequested from lms.djangoapps.courseware.utils import verified_upgrade_deadline_link, can_show_verified_upgrade from lms.djangoapps.discussion.notification_prefs.views import UsernameCipher @@ -154,6 +155,13 @@ def get_schedules_with_target_date_by_bin_and_orgs( schedules = self.filter_by_org(schedules) + try: + # .. filter_implemented_name: ScheduleQuerySetRequested + # .. filter_type: org.openedx.learning.schedule.queryset.requested.v1 + schedules = ScheduleQuerySetRequested.run_filter(schedules) + except ScheduleQuerySetRequested.PreventScheduleQuerysetRequest as exc: + schedules = exc.schedules + if "read_replica" in settings.DATABASES: schedules = schedules.using("read_replica")