-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: filter user's course enrollment by microsite request
- Loading branch information
1 parent
f0fb19c
commit f95e494
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
""" | ||
The pipeline module defines custom Filters functions that are used in openedx-filters. | ||
""" | ||
from openedx_filters import PipelineStep | ||
|
||
from eox_tenant.tenant_aware_functions.enrollments import filter_enrollments | ||
|
||
|
||
class FilterUserCourseEnrollmentsByTenant(PipelineStep): | ||
""" | ||
Filter enrollments list by a tenant. | ||
""" | ||
|
||
def run_filter(self, context): # pylint: disable=arguments-differ | ||
""" | ||
Filter especific user course enrollments by tenant request. | ||
Example Usage: | ||
Add the following configurations to you configuration file | ||
"OPEN_EDX_FILTERS_CONFIG": { | ||
"org.openedx.learning.course_enrollments_site.filter.requested.v1": { | ||
"fail_silently": false, | ||
"pipeline": [ | ||
"eox_tenant.filters.pipeline.FilterUserCourseEnrollmentsByTenant" | ||
] | ||
} | ||
} | ||
""" | ||
tenant_enrollments = filter_enrollments(context) | ||
return {"context": tenant_enrollments} |