-
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 9deaf81
Showing
1 changed file
with
28 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,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} |