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 16, 2022
1 parent f0fb19c commit 9deaf81
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions eox_tenant/filters/pipeline.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
"""
Custom Filters Tenant.
"""
from eox_tenant.tenant_aware_functions.enrollments import filter_enrollments
from openedx_filters import PipelineStep


class FilterEnrollmentsByTenant(PipelineStep):
"""
Filter enrollments list by a tenant.
"""

def run_filter(self, context):
"""
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.filter_enrollments_site.render.started.v1": {
"fail_silently": false,
"pipeline": [
"eox_tenant.filters.pipeline.FilterEnrollmentsByTenant"
]
}
}
"""
tenant_enrollments = filter_enrollments(context)
return {"context": tenant_enrollments}

0 comments on commit 9deaf81

Please sign in to comment.