Skip to content

Commit

Permalink
feat: filter user's course enrollment by microsite request
Browse files Browse the repository at this point in the history
  • Loading branch information
JuanDavidBuitrago committed Nov 19, 2022
1 parent f0fb19c commit f95e494
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions eox_tenant/filters/pipeline.py
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}

0 comments on commit f95e494

Please sign in to comment.