Filters#
This is the list of Open edX Filters found in this repository.
Note
Filters can be created in other projects and plugins as well, but these default filters are guaranteed to exist.
Learning Subdomain#
Package where filters related to the learning architectural subdomain are implemented.
- class openedx_filters.learning.filters.AccountSettingsReadOnlyFieldsRequested[source]#
Filter used to expand the set of read-only fields on the account settings API.
- Purpose:
This filter is triggered when the account settings API validates which fields may be updated for a given user. Pipeline steps may add field names to
readonly_fieldsto mark those fields as read-only for the requesting user.- Filter Type:
org.openedx.learning.account.settings.read_only_fields.requested.v1
- Trigger:
Repository: openedx/openedx-platform
Path: openedx/core/djangoapps/user_api/accounts/api.py
Function or Method: _validate_read_only_fields
- classmethod run_filter(readonly_fields: set, user: Any) tuple[set, Any][source]#
Process the readonly_fields set using the configured pipeline steps.
- Parameters:
readonly_fields (set) – the set of field names the caller considers read-only. Pipeline steps add field names to this set to mark additional fields as read-only.
user (User) – the Django User whose account settings are being updated.
- Returns:
Any: the (possibly expanded) set of read-only field names. Any: the Django User object.
- Return type:
tuple[Any | Any]
- class openedx_filters.learning.filters.AccountSettingsRenderStarted[source]#
Filter used to modify the rendering of the account settings page in the LMS.
- Purpose:
This filter is triggered when a user visits the account settings page, just before the page is rendered allowing the filter to modify the context and the template used to render the page.
- Filter Type:
org.openedx.learning.student.settings.render.started.v1
- Trigger:
Repository: openedx/openedx-platform
Path: openedx/core/djangoapps/user_api/accounts/settings_views.py
Function or Method: account_settings
- Additional Information:
This filter doesn’t work alongside the account MFE, only with the legacy account settings page.
- exception RedirectToPage(message: str, redirect_to: str)[source]#
Raise to trigger a redirect before the account settings page is rendered.
This exception is propagated to the account settings view and handled by the view to redirect the user to a new page.
- message#
error message for the exception.
- Type:
str
- redirect_to#
URL to redirect to.
- Type:
str
- exception RenderCustomResponse(message: str, response: HttpResponse | None = None)[source]#
Raise to return a custom response instead of the usual account settings page.
This exception is propagated to the account settings view and handled by the view to return a custom response instead.
- message#
error message for the exception.
- Type:
str
- response#
custom response which will be returned by the account settings view.
- Type:
HttpResponse
- exception RenderInvalidAccountSettings(message: str, account_settings_template: str = '', template_context: dict | None = None)[source]#
Raise to render a different template instead of the account settings page.
This exception is propagated to the account settings view and handled by the view to render a different template instead.
- message#
error message for the exception.
- Type:
str
- account_settings_template#
template path rendered instead.
- Type:
str
- template_context#
context used to the new account settings template.
- Type:
dict
- classmethod run_filter(context: dict[str, Any], template_name: str) tuple[dict[str, Any] | None, str | None][source]#
Process the input context and template_name using the configured pipeline steps to modify the account settings.
- Parameters:
context (dict) – template context for the account settings page.
template_name (str) – template path used to render the account settings page.
- Returns:
dict: context dictionary for the account settings page, possibly modified.
str: template name to be rendered by the account settings page, possibly modified.
- Return type:
tuple[dict, str]
- class openedx_filters.learning.filters.CertificateCreationRequested[source]#
Filter used to modify the certificate creation process for a given user in a course.
- Purpose:
This filter is triggered when a user requests a certificate, just before the certificate is created allowing the filter to act on the user, course key, mode, status, grade, and generation mode.
- Filter Type:
org.openedx.learning.certificate.creation.requested.v1
- Trigger:
Repository: openedx/openedx-platform
Path: lms/djangoapps/certificates/generated_certificate.py
Function or Method: _generate_certificate_task
- exception PreventCertificateCreation(message: str = '', redirect_to: str = '', status_code: int | None = None, **kwargs)[source]#
Raise to prevent the certificate creation process to continue.
This exception is propagated from the certificate generation function and handled by the caller to stop the certificate creation process before starting the async task.
- classmethod run_filter(user: Any, course_key: CourseKey, mode: str, status: str, grade: float, generation_mode: str) tuple[Any, CourseKey | None, str | None, str | None, float | None, str | None][source]#
Process the inputs using the configured pipeline steps to modify the certificate creation process.
- Parameters:
user (User) – Django User object.
course_key (CourseKey) – course key associated with the certificate.
mode (str) – specifies what kind of certificate.
status (str) – specifies the status of the certificate.
grade (float) – grade of the certificate.
generation_mode (str) – specifies the mode of generation.
- Returns:
User: Django User object.
CourseKey: course key associated with the certificate.
str: mode of the certificate.
str: status of the certificate.
float: grade of the certificate.
str: mode of generation.
- Return type:
tuple[User, CourseKey, str, str, float, str]
- class openedx_filters.learning.filters.CertificateRenderStarted[source]#
Filter used to modify the rendering of a certificate.
- Purpose:
This filter is triggered when a user requests to view the certificate, just before the certificate is rendered allowing the filter to act on the context and the template used to render the certificate.
- Filter Type:
org.openedx.learning.certificate.render.started.v1
- Trigger:
Repository: openedx/openedx-platform
Path: lms/djangoapps/certificates/views/webview.py
Function or Method: render_html_view
- exception RedirectToPage(message: str, redirect_to: str = '')[source]#
Raise to redirect to a different page instead of rendering the certificate.
This exception is propagated to the certificate view and handled by the view to redirect the user to a new page.
- message#
error message for the exception.
- Type:
str
- redirect_to#
URL to redirect to.
- Type:
str
- exception RenderAlternativeInvalidCertificate(message: str, template_name: str = '')[source]#
Raise to render a different certificate template instead of the default one.
This exception is propagated to the certificate view and handled by the view to render a different template instead.
- message#
error message for the exception.
- Type:
str
- template_name#
template path of the new certificate.
- Type:
str
- exception RenderCustomResponse(message: str, response: HttpResponse)[source]#
Raise to stop the certificate rendering process and return a custom response.
This exception is propagated to the certificate view and handled by the view to return a custom response instead.
- message#
error message for the exception.
- Type:
str
- response#
custom response which will be returned by the certificate view.
- Type:
HttpResponse
- classmethod run_filter(context: dict, custom_template: Any) tuple[dict[str, Any] | None, Any][source]#
Process the context and custom_template using the configured pipeline steps to modify the certificate rendering.
- Parameters:
context (dict) – context dictionary for certificate template.
custom_template (CertificateTemplate) – custom web certificate template.
- Returns:
dict: context dictionary for the certificate template, possibly modified.
CertificateTemplate: custom web certificate template, possibly modified.
- Return type:
tuple[dict, CertificateTemplate]
- class openedx_filters.learning.filters.CohortAssignmentRequested[source]#
Filter used to modify the cohort assignment process.
- Purpose:
This filter is triggered when a user is assigned to a cohort, just before the assignment is completed allowing the filter to act on the user and the target cohort.
- Filter Type:
org.openedx.learning.cohort.assignment.requested.v1
- Trigger:
Repository: openedx/openedx-platform
Path: openedx/core/djangoapps/course_groups/models.py
Function or Method: assign
- exception PreventCohortAssignment(message: str = '', redirect_to: str = '', status_code: int | None = None, **kwargs)[source]#
Raise to prevent the cohort assignment process to continue.
This exception is propagated to the assign method and handled by it to stop the cohort assignment process.
- message#
error message for the exception.
- Type:
str
- redirect_to#
URL to redirect to.
- Type:
str
- classmethod run_filter(user: Any, target_cohort: Any) tuple[Any, Any][source]#
Process the user and target_cohort using the configured pipeline steps to modify the cohort assignment process.
- Parameters:
user (User) – Django User object representing the user.
target_cohort (CourseUserGroup) – CourseUserGroup instance representing the new user’s cohort.
- Returns:
User: Django User object representing the user.
CourseUserGroup: CourseUserGroup instance representing the new user’s cohort.
- Return type:
tuple[User, CourseUserGroup]
- class openedx_filters.learning.filters.CohortChangeRequested[source]#
Filter used to modify the cohort change process.
- Purpose:
This filter is triggered when a user’s cohort is changed, just before the change is completed allowing the filter to act on the user and the target cohort.
- Filter Type:
org.openedx.learning.cohort.change.requested.v1
- Trigger:
Repository: openedx/openedx-platform
Path: openedx/core/djangoapps/course_groups/models.py
Function or Method: assign
- exception PreventCohortChange(message: str = '', redirect_to: str = '', status_code: int | None = None, **kwargs)[source]#
Raise to prevent the cohort change process to continue.
This exception is propagated to the assign method and handled by it to stop the cohort change process.
- classmethod run_filter(current_membership: Any, target_cohort: Any) tuple[Any, Any][source]#
Process the inputs using the configured pipeline steps to modify the cohort change process.
- Parameters:
current_membership (CohortMembership) – CohortMembership instance representing the current user’s cohort.
target_cohort (CourseUserGroup) – CourseUserGroup instance representing the new user’s cohort.
- Returns:
CohortMembership: CohortMembership instance representing the current user’s cohort.
CourseUserGroup: CourseUserGroup instance representing the new user’s cohort.
- Return type:
tuple[CohortMembership, CourseUserGroup]
- class openedx_filters.learning.filters.CourseAboutPageURLRequested[source]#
Filter used to act on course about page URL requests.
- Purpose:
This filter is triggered when a user requests to view the course about page, just before the page is rendered allowing the filter to act on the URL of the page and the course org.
- Filter Type:
org.openedx.learning.course_about.page.url.requested.v1
- Trigger:
Repository: openedx/openedx-platform
Path: common/djangoapps/util/course.py
Function or Method: get_link_for_about_page
- classmethod run_filter(url: str, org: str) tuple[str | None, str | None][source]#
Process the URL and org using the configured pipeline steps to modify the course about page URL.
- Parameters:
url (str) – the URL of the page to be modified.
org (str) – Course org filter used as context data to get LMS configurations.
- Returns:
str: the modified URL of the page.
str: Course org filter used as context data to get LMS configurations.
- Return type:
tuple[str, str]
- class openedx_filters.learning.filters.CourseAboutRenderStarted[source]#
Filter used to modify the course about rendering process.
- Purpose:
This filter is triggered when a user requests to view the course about page, just before the page is rendered allowing the filter to act on the context and the template used to render the page.
- Filter Type:
org.openedx.learning.course_about.render.started.v1
- Trigger:
Repository: openedx/openedx-platform
Path: lms/djangoapps/courseware/views/views.py
Function or Method: course_about
- exception RedirectToPage(message: str, redirect_to: str = '')[source]#
Raise to redirect to a different page instead of rendering the course about.
This exception is propagated to the course about view and handled by the view to redirect the user to a new page.
- message#
error message for the exception.
- Type:
str
- redirect_to#
URL to redirect to.
- Type:
str
- exception RenderCustomResponse(message: str, response: HttpResponse)[source]#
Raise to stop the course about rendering process and return a custom response.
This exception is propagated to the course about view and handled by the view to return a custom response instead.
- exception RenderInvalidCourseAbout(message: str, course_about_template: str = '', template_context: dict | None = None)[source]#
Raise to render a different course about template instead of the default one.
This exception is propagated to the course about view and handled by the view to render a different template instead.
- message#
error message for the exception.
- Type:
str
- course_about_template#
template path rendered instead.
- Type:
str
- template_context#
context used to the new course_about_template.
- Type:
dict
- classmethod run_filter(context: dict[str, Any], template_name: str) tuple[dict[str, Any] | None, str | None][source]#
Process the context and template_name using the configured pipeline steps to modify the course about rendering.
- Parameters:
context (dict) – context dictionary for course about template.
template_name (str) – template name to be rendered by the course about.
- Returns:
dict: context dictionary for the course about template, possibly modified.
str: template name to be rendered by the course about, possibly modified.
- Return type:
tuple[dict, str]
- class openedx_filters.learning.filters.CourseEnrollmentAPIRenderStarted[source]#
Filter used to modify the course enrollment API rendering process.
- Purpose:
This filter is triggered when a user requests to view the course enrollment API, just before the API is rendered allowing the filter to act on the course key and serialized enrollment data.
- Filter Type:
org.openedx.learning.home.enrollment.api.rendered.v1
- Trigger:
Repository: openedx/openedx-platform
Path: lms/djangoapps/learner_home/serializers.py
Function or Method: EnrollmentSerializer.to_representation
- classmethod run_filter(course_key: CourseKey, serialized_enrollment: dict[str, Any]) tuple[CourseKey | None, dict[str, Any] | None][source]#
Process the inputs using the configured pipeline steps to modify the course enrollment data.
- Parameters:
course_key (CourseKey) – The course key for which isStarted is being modify.
serialized_enrollment (dict) – enrollment data.
- Returns:
CourseKey: The course key for which isStarted is being modify.
dict: enrollment data.
- Return type:
tuple[CourseKey, dict]
- class openedx_filters.learning.filters.CourseEnrollmentQuerysetRequested[source]#
Filter used to modify the QuerySet of course enrollments.
- Purpose:
This filter is triggered when a QuerySet of course enrollments is requested, allowing the filter to act on the enrollments data.
- Filter Type:
org.openedx.learning.course_enrollment_queryset.requested.v1
Trigger: NA
- Additional Information:
This filter is not currently triggered by any specific function or method in any codebase. It should be marked to be removed if it’s not used. See openedx-filters#245 for more information.
- exception PreventEnrollmentQuerysetRequest(message: str = '', redirect_to: str = '', status_code: int | None = None, **kwargs)[source]#
Raise to prevent the course enrollment queryset request to continue.
- classmethod run_filter(enrollments: QuerySet) QuerySet | None[source]#
Process the enrollments QuerySet using the configured pipeline steps to modify the course enrollment data.
- Parameters:
enrollments (QuerySet) – data with all user’s course enrollments.
- Returns:
data with all user’s course enrollments, possibly modified.
- Return type:
QuerySet
- class openedx_filters.learning.filters.CourseEnrollmentStarted[source]#
Filter used to modify the enrollment process for a given user in a course.
- Purpose:
This filter is triggered when a user initiates the enrollment process, just before the enrollment is completed allowing the filter to act on the user, course key, and mode.
- Filter Type:
org.openedx.learning.course.enrollment.started.v1
- Trigger:
Repository: openedx/openedx-platform
Path: common/djangoapps/student/models/course_enrollment.py
Function or Method: enroll
- exception PreventEnrollment(message: str = '', redirect_to: str = '', status_code: int | None = None, **kwargs)[source]#
Raise to prevent the enrollment process to continue.
This exception is propagated to the course enrollment model and handled by the model to stop the enrollment process. All components using the enroll method handle this exception in the appropriate way.
- classmethod run_filter(user: Any, course_key: CourseKey, mode: str) tuple[Any, CourseKey | None, str | None][source]#
Process the user, course_key, and mode using the configured pipeline steps to modify the enrollment process.
- Parameters:
user (User) – Django User enrolling in the course.
course_key (CourseKey) – course key associated with the enrollment.
mode (str) – specifies what kind of enrollment. The course modes available are: audit, professional, verified, honor and professional
- Returns:
User: Django User object.
CourseKey: course key associated with the enrollment.
str: mode of the enrollment.
- Return type:
tuple[Any, CourseKey, str]
- class openedx_filters.learning.filters.CourseEnrollmentViewStarted[source]#
Filter used to perform pre-enrollment processing during the enrollment REST API view.
- Purpose:
This filter is triggered when a user initiates enrollment via the enrollment REST API view, just before the enrollment is created, allowing pipeline steps to perform pre-enrollment processing scoped to the view layer.
- Filter Type:
org.openedx.learning.course.enrollment.view.started.v1
- Trigger:
Repository: openedx/openedx-platform
Path: openedx/core/djangoapps/enrollments/views.py
Function or Method: EnrollmentListView.post
- exception PreventEnrollment(message: str = '', redirect_to: str = '', status_code: int | None = None, **kwargs)[source]#
Raise to prevent the enrollment process from continuing.
- classmethod run_filter(user: Any, course_key: CourseKey, requester_is_backend_service: bool) tuple[Any, CourseKey, bool][source]#
Process the user, course_key, and requester_is_backend_service using the configured pipeline steps to preempt the enrollment process.
- Parameters:
user (User) – Django User enrolling in the course.
course_key (CourseKey) – course key associated with the enrollment.
requester_is_backend_service (bool) – if request was made by a server with an API key.
- Returns:
User: Django User object.
CourseKey: course key associated with the enrollment.
bool: if request was made by a server with an API key.
- Return type:
tuple[Any, CourseKey, bool]
- class openedx_filters.learning.filters.CourseHomeUrlCreationStarted[source]#
Filter used to modify the course home url creation process.
- Purpose:
This filter is triggered when a course home url is being generated, just before the generation process is completed allowing the filter to act on the course key and course home url.
- Filter Type:
org.openedx.learning.course.homepage.url.creation.started.v1
- Trigger:
Repository: openedx/openedx-platform
Path: openedx/features/course_experience/__init__.py
Function or Method: course_home_url
- classmethod run_filter(course_key: CourseKey, course_home_url: str) tuple[CourseKey | None, str | None][source]#
Process the course_key and course_home_url using the configured pipeline steps to modify the course home url.
- Parameters:
course_key (CourseKey) – The course key for which the home url is being requested.
course_home_url (str) – The url string for the course home.
- Returns:
CourseKey: The course key for which the home url is being requested.
str: The url string for the course home.
- Return type:
tuple[CourseKey, str]
- class openedx_filters.learning.filters.CourseModePriceRequested[source]#
Filter used to determine the price a learner should be charged for a course mode.
- Purpose:
This filter is triggered when the price for a course mode checkout needs to be calculated. Pipeline steps can adjust the price and apply discounts, like enterprise-negotiated pricing.
- Filter Type:
org.openedx.learning.course_mode.price.requested.v1
- Trigger:
Repository: openedx/openedx-platform
Path: common/djangoapps/course_modes/views.py
Function or Method: ChooseModeView.get
- classmethod run_filter(user: Any, course_mode_data: Any, price: int) tuple[Any, Any, int][source]#
Process and possibly adjust the price through the configured pipeline steps.
- Parameters:
user (Any) – The Django User object.
course_mode_data (Any) – The selected course mode object.
price (int) – Price of the course mode in whole currency units (e.g., dollars, not cents). The currency is stored on the course_mode_data object (course_mode_data.currency).
- Returns:
user (Any): django User object (unchanged)
course_mode_data (Any): The selected course mode object (unchanged)
price (int): Price (possibly adjusted)
- Return type:
tuple[Any, Any, int]
- class openedx_filters.learning.filters.CourseRunAPIRenderStarted[source]#
Filter used to modify the course run API rendering process.
- Purpose:
This filter is triggered when a user requests to view the course run API, just before the API is rendered allowing the filter to act on the serialized course run data.
- Filter Type:
org.openedx.learning.home.courserun.api.rendered.started.v1
- Trigger:
Repository: openedx/openedx-platform
Path: lms/djangoapps/learner_home/serializers.py
Function or Method: CourseRunSerializer.to_representation
- class openedx_filters.learning.filters.CourseStartDateValidationFailed[source]#
Filter triggered from the failure branch of the course start-date access check.
- Purpose:
Invoked after start-date validation has already failed for the base case, allowing pipeline steps to substitute a more specific access-error payload. A step that wants to override the default error raises the nested
OverrideStartDateErrorexception; the platform catches it and builds aStartDateFiltersErrorfrom the exception’s fields.The first pipeline step to raise wins; later steps do not run.
- Filter Type:
org.openedx.learning.course.start_date.validation_failed.v1
- Trigger:
Repository: openedx/openedx-platform
Path: lms/djangoapps/courseware/access_utils.py
Function or Method: check_start_date
- exception OverrideStartDateError(message: str, error_code: str, developer_message: str, user_message: str)[source]#
Raised by a pipeline step to substitute a more specific start-date access error.
The caller decides whether to surface
user_messagein the UI.
- classmethod run_filter(course_key: CourseKey, start_date: datetime) tuple[CourseKey, datetime][source]#
Run the pipeline so plugins can substitute a more specific start-date error.
- Parameters:
course_key (CourseKey) – the course key for the view being accessed.
start_date (datetime) – the course start date.
- Returns:
the inputs unchanged.
- Return type:
tuple[CourseKey, datetime]
- class openedx_filters.learning.filters.CourseUnenrollmentStarted[source]#
Filter used to modify the unenrollment process for a given user from a course.
- Purpose:
This filter is triggered when a user initiates the unenrollment process, just before the unenrollment is completed allowing the filter to act on the user’s enrollment in the course.
- Filter Type:
org.openedx.learning.course.unenrollment.started.v1
- Trigger:
Repository: openedx/openedx-platform
Path: common/djangoapps/student/models/course_enrollment.py
Function or Method: unenroll
- exception PreventUnenrollment(message: str = '', redirect_to: str = '', status_code: int | None = None, **kwargs)[source]#
Raised to prevent the unenrollment process to continue.
This exception is propagated to the course enrollment model and handled by the model to stop the unenrollment process. All components using the unenroll method handle this exception in the appropriate way.
- classmethod run_filter(enrollment: Any) Any[source]#
Process the enrollment object using the configured pipeline steps to modify the unenrollment process.
- Parameters:
enrollment (CourseEnrollment) – user’s enrollment in the course.
- Returns:
user’s enrollment in the course.
- Return type:
CourseEnrollment
- class openedx_filters.learning.filters.CoursewareAccessChecksRequested[source]#
Filter triggered during courseware access checks so plugins can deny access.
- Purpose:
Invoked from the courseware access-check flow after platform-internal checks have passed. Pipeline steps that wish to deny access raise the nested
PreventCoursewareAccessexception, which the framework propagates back to the caller regardless offail_silently. Denials surfaced through this filter are treated as priority — i.e. they cannot be bypassed by staff users.The first pipeline step to raise wins; later steps do not run.
- Filter Type:
org.openedx.learning.courseware.access_checks.requested.v1
- Trigger:
Repository: openedx/openedx-platform
Path: lms/djangoapps/courseware/courses.py
Function or Method: check_course_access
- exception PreventCoursewareAccess(message: str, error_code: str, developer_message: str, user_message: str)[source]#
Raised by a pipeline step to deny courseware access.
- classmethod run_filter(user: Any, course_key: CourseKey) tuple[Any, CourseKey][source]#
Run the pipeline so plugins can deny access.
- Parameters:
user – the user whose access is being checked.
course_key – the course key being accessed.
- Returns:
(user, course_key), unchanged.- Return type:
tuple[Any, CourseKey]
- class openedx_filters.learning.filters.CoursewareViewStarted[source]#
Filter triggered before a courseware view is rendered, allowing pipeline steps to redirect.
- Purpose:
Invoked before a courseware view renders. A pipeline step that wants to redirect the user raises the nested
RedirectToUrlexception with the target URL. The platform decorator catches the exception and callsdjango.shortcuts.redirect.The first pipeline step to raise wins; later steps do not run.
- Filter Type:
org.openedx.learning.courseware.view.started.v1
- Trigger:
Repository: openedx/openedx-platform
Path: lms/djangoapps/courseware/decorators.py
Function or Method: courseware_view_hooks
- exception RedirectToUrl(message: str, redirect_to: str)[source]#
Raised by a pipeline step to redirect the user before the courseware view renders.
- classmethod run_filter(course_key: CourseKey, view_name: str) tuple[CourseKey, str][source]#
Run the pipeline so plugins can redirect the user.
- Parameters:
course_key (CourseKey) – the course key for the view being accessed.
view_name (str) – name of the view function being accessed (e.g. ‘index’, ‘progress’), used by pipeline steps for logging/auditing purposes.
- Returns:
(course_key, view_name), unchanged.- Return type:
tuple[CourseKey, str]
Note
Pipeline steps that need the current request should obtain it via
crum.get_current_request()rather than expecting it as a kwarg.
- class openedx_filters.learning.filters.DashboardRenderStarted[source]#
Filter used to modify the dashboard rendering process.
- Purpose:
This filter is triggered when a user requests to view the dashboard, just before the page is rendered allowing the filter to act on the context and the template used to render the page.
- Filter Type:
org.openedx.learning.dashboard.render.started.v1
- Trigger:
Repository: openedx/openedx-platform
Path: common/djangoapps/student/views/dashboard.py
Function or Method: student_dashboard
- Additional Information:
This filter doesn’t work alongside the dashboard MFE, only with the legacy student dashboard.
- exception RedirectToPage(message: str, redirect_to: str = '')[source]#
Raise to redirect to a different page instead of rendering the dashboard.
This exception is propagated to the dashboard view and handled by the view to redirect the user to a new page.
- message#
error message for the exception.
- Type:
str
- redirect_to#
URL to redirect to.
- Type:
str
- exception RenderCustomResponse(message: str, response: HttpResponse | None = None)[source]#
Raise to stop the dashboard rendering process and return a custom response.
This exception is propagated to the dashboard view and handled by the view to return a custom response instead.
- message#
error message for the exception.
- Type:
str
- response#
custom response which will be returned by the dashboard view.
- Type:
HttpResponse
- exception RenderInvalidDashboard(message: str, dashboard_template: str = '', template_context: dict | None = None)[source]#
Raise to render a different dashboard template instead of the default one.
This exception is propagated to the dashboard view and handled by the view to render a different template instead.
- message#
error message for the exception.
- Type:
str
- dashboard_template#
template path rendered instead.
- Type:
str
- template_context#
context used to the new dashboard_template.
- Type:
dict
- classmethod run_filter(context: dict[str, Any], template_name: str) tuple[dict[str, Any] | None, str | None][source]#
Process the context and template_name using the configured pipeline steps to modify the dashboard rendering.
- Parameters:
context (dict) – context dictionary for student’s dashboard template.
template_name (str) – template name to be rendered by the student’s dashboard.
- Returns:
dict: context dictionary for the student’s dashboard template, possibly modified.
str: template name to be rendered by the student’s dashboard, possibly modified.
- Return type:
tuple[dict, str]
- class openedx_filters.learning.filters.DiscountEligibilityCheckRequested[source]#
Filter used to allow plugins to mark a user as ineligible for a course discount.
- Purpose:
This filter is triggered during discount applicability checks, just before the final eligibility decision is returned to the caller. Pipeline steps may raise
DiscountIneligibleto exclude a user from receiving a discount.- Filter Type:
org.openedx.learning.discount.eligibility.check.requested.v1
- Trigger:
Repository: openedx/openedx-platform
Path: openedx/features/discounts/applicability.py
Function or Method: can_receive_discount, can_show_streak_discount_coupon
- exception DiscountIneligible(message: str = '', redirect_to: str = '', status_code: int | None = None, **kwargs)[source]#
Raised by a pipeline step to indicate user is ineligible for discounts
- classmethod run_filter(user: Any, course_key: CourseKey) tuple[Any, CourseKey][source]#
Process the inputs using the configured pipeline steps.
- Parameters:
user (User) – the Django User being checked for discount eligibility.
course_key (CourseKey or course object) – identifies the course.
- Returns:
User: the Django User object (unchanged).
CourseKey: the course key (unchanged).
bool: the (possibly overridden) eligibility flag.
- Return type:
tuple[User, CourseKey, bool]
- Raises:
DiscountIneligible – when a pipeline step determines the user is not eligible for a discount and halts further processing.
- class openedx_filters.learning.filters.GradeEventContextRequested[source]#
Filter used to enrich the context for grade events.
- Purpose:
This filter is triggered when a grade event context is requested, allowing pipeline steps to enrich the context dictionary with additional data.
- Filter Type:
org.openedx.learning.grade.context.requested.v1
- Trigger:
Repository: openedx/openedx-platform
Path: lms/djangoapps/grades/events.py
Function or Method: course_grade_passed_first_time
- classmethod run_filter(context: dict, user_id: int, course_id: str) tuple[dict, int, str][source]#
Process the context dict using the configured pipeline steps.
- Parameters:
context (dict) – The grade event context to be enriched.
user_id (int) – The ID of the user associated with the grade event.
course_id (str) – The identifier of the course.
- Returns:
dict: The enriched grade event context. int: The user ID. str: The course identifier.
- Return type:
tuple[dict, int, str]
- class openedx_filters.learning.filters.IDVPageURLRequested[source]#
Filter used to act on ID verification page URL requests.
- Purpose:
This filter is triggered when a user requests to view the ID verification page, just before the page is rendered allowing the filter to act on the URL of the page.
- Filter Type:
org.openedx.learning.idv.page.url.requested.v1
- Trigger:
Repository: openedx/openedx-platform
Path: lms/djangoapps/verify_student/services.py
Function or Method: XBlockVerificationService.get_verify_location
- class openedx_filters.learning.filters.InstructorDashboardRenderStarted[source]#
Filter used to modify the instructor dashboard rendering process.
- Purpose:
This filter is triggered when an instructor requests to view the dashboard, just before the page is rendered allowing the filter to act on the context and the template used to render the page.
There’s a new version of this filter (org.openedx.learning.instructor.dashboard.tabs.requested.v1) that applies to the instructor dashboard app, but this filter will still be triggered for the legacy instructor dashboard.
- Filter Type:
org.openedx.learning.instructor.dashboard.render.started.v1
- Trigger:
Repository: openedx/openedx-platform
Path: lms/djangoapps/instructor/views/instructor_dashboard.py
Function or Method: instructor_dashboard_2
- exception RedirectToPage(message: str, redirect_to: str = '')[source]#
Raise to redirect to a different page instead of rendering the instructor dashboard.
This exception is propagated to the instructor dashboard view and handled by the view to redirect the user to a new page.
- message#
error message for the exception.
- Type:
str
- redirect_to#
URL to redirect to.
- Type:
str
- exception RenderCustomResponse(message: str, response: HttpResponse | None = None)[source]#
Raise to stop the instructor dashboard rendering process and return a custom response.
This exception is propagated to the instructor dashboard view and handled by the view to return a custom response instead.
- message#
error message for the exception.
- Type:
str
- response#
custom response which will be returned by the dashboard view.
- Type:
HttpResponse
- exception RenderInvalidDashboard(message: str, instructor_template: str = '', template_context: dict | None = None)[source]#
Raise to render a different instructor dashboard template instead of the default one.
This exception is propagated to the instructor dashboard view and handled by the view to render a different template instead.
- message#
error message for the exception.
- Type:
str
- instructor_template#
template path rendered instead.
- Type:
str
- template_context#
context used to the new instructor_template
- Type:
dict
- classmethod run_filter(context: dict[str, Any], template_name: str) tuple[dict[str, Any] | None, str | None][source]#
Process the context and template_name using the configured pipeline steps to modify the instructor dashboard.
- Parameters:
context (dict) – context dictionary for instructor’s tab template.
template_name (str) – template name to be rendered by the instructor’s tab.
- Returns:
dict: context dictionary for the instructor’s tab template, possibly modified.
str: template name to be rendered by the instructor’s tab, possibly modified.
- Return type:
tuple[dict, str]
- class openedx_filters.learning.filters.InstructorDashboardTabsRequested[source]#
Filter used to modify the instructor dashboard tabs generation process.
- Purpose:
This filter is triggered when instructor dashboard tabs are generated, allowing plugins to add, modify, or remove tabs from the instructor dashboard in the MFE.
There’s an old version of this filter (org.openedx.learning.instructor.dashboard.render.started.v1) that applies to the legacy instructor dashboard, but this new filter is specifically designed to work with the instructor dashboard app and its tabs generation process.
- Filter Type:
org.openedx.learning.instructor.dashboard.tabs.requested.v1
- Trigger:
Repository: openedx/openedx-platform
Path: lms/djangoapps/instructor/views/serializers_v2.py
Function or Method: CourseInformationSerializerV2.get_tabs
- exception PreventTabsGeneration(message: str, tabs: list | None = None)[source]#
Raise to prevent the normal tabs generation process and optionally provide custom tabs.
This exception is propagated to the instructor dashboard serializer and handled to stop the normal tab generation process. Plugins can provide their own tabs list.
- message#
error message for the exception.
- Type:
str
- tabs#
optional custom tabs list to use instead.
- Type:
list
- classmethod run_filter(tabs: list, user: Any, course_key: CourseKey) tuple[list | None, Any | None, CourseKey | None][source]#
Process the tabs list using the configured pipeline steps to modify instructor dashboard tabs. :param tabs: List of tab dictionaries containing tab_id, title, url, sort_order, etc. :type tabs: list :param user: Django User object (usually an instructor or staff member). :type user: User :param course_key: Course key for the instructor dashboard. :type course_key: CourseKey
- Returns:
list | None: Tab dictionaries, possibly modified by pipeline steps, or None if not provided.
Any | None: User object, possibly modified by pipeline steps, or None if not provided.
CourseKey | None: Course key, possibly modified by pipeline steps, or None if not provided.
- Return type:
tuple[list | None, Any | None, CourseKey | None]
- class openedx_filters.learning.filters.ORASubmissionViewRenderStarted[source]#
Filter used to modify the submission view rendering process.
- Purpose:
This filter is triggered when a user requests to view the submission, just before the page is rendered allowing the filter to act on the context and the template used to render the page.
- Filter Type:
org.openedx.learning.ora.submission_view.render.started.v1
- Trigger:
Repository: openedx/edx-ora2
Path: openassessment/xblock/ui_mixins/legacy/views/submission.py
Function or Method: render_submission
- exception RenderInvalidTemplate(message: str, context: dict | None = None, template_name: str = '')[source]#
Raise to render a different submission view template instead of the default one.
This exception is propagated to the submission view and handled by the view to render a different template instead.
- Parameters:
message (str) – error message for the exception.
context (dict) – context used to the submission view template.
template_name (str) – template path rendered instead.
- classmethod run_filter(context: dict[str, Any], template_name: str) tuple[dict[str, Any] | None, str | None][source]#
Process the context and template_name using the configured pipeline steps to modify the submission view.
- Parameters:
context (dict) – context dictionary for submission view template.
template_name (str) – template name to be rendered by the student’s dashboard.
- Returns:
dict: context dictionary for the submission view template, possibly modified.
str: template name to be rendered by the submission view, possibly modified.
- Return type:
tuple[dict, str]
- class openedx_filters.learning.filters.RenderXBlockStarted[source]#
Filter in between context generation and rendering of XBlock scope.
- Purpose:
This filter is triggered when an XBlock is about to be rendered, just before the rendering process is completed allowing the filter to act on the context and student_view_context used to render the XBlock.
- Filter Type:
org.openedx.learning.xblock.render.started.v1
- Trigger:
Repository: openedx/openedx-platform
Path: lms/djangoapps/courseware/views/views.py
Function or Method: render_xblock
- exception PreventXBlockBlockRender(message: str = '', redirect_to: str = '', status_code: int | None = None, **kwargs)[source]#
Raise to prevent the XBlock from rendering for the user.
This exception is propagated to the XBlock render view and handled by the view to stop the rendering of the XBlock.
- exception RenderCustomResponse(message: str, response: HttpResponse | None = None)[source]#
Raise to stop the XBlock rendering process by returning a custom response.
This exception is propagated to the XBlock render view and handled by the view to return a custom response instead.
- message#
error message for the exception.
- Type:
str
- response#
custom response which will be returned by the XBlock render view.
- Type:
HttpResponse
- classmethod run_filter(context: dict[str, Any], student_view_context: dict) tuple[dict[str, Any] | None, dict[str, Any] | None][source]#
Process the inputs using the configured pipeline steps to modify the rendering of an XBlock.
- Parameters:
context (dict) – rendering context values like is_mobile_app, show_title, etc.
student_view_context (dict) – context passed to the student_view of the block context.
- Returns:
dict: rendering context values like is_mobile_app, show_title, etc.
dict: context passed to the student_view of the block context.
- Return type:
tuple[dict, dict]
- class openedx_filters.learning.filters.ScheduleQuerySetRequested[source]#
Filter used to apply additional filtering to a given QuerySet of Schedules.
- Purpose:
This filter is triggered when a QuerySet of Schedules is requested, allowing the filter to act on the schedules data. If you want to know more about the Schedules feature, please refer to the official documentation:
- Filter Type:
org.openedx.learning.schedule.queryset.requested.v1
- Trigger:
Repository: openedx/openedx-platform
Path: openedx/core/djangoapps/schedules/resolvers.py
Function or Method: BinnedSchedulesBaseResolver.get_schedules_with_target_date_by_bin_and_orgs
- classmethod run_filter(schedules: QuerySet) QuerySet | None[source]#
Process the schedules QuerySet using the configured pipeline steps to modify the schedules data.
- Parameters:
schedules (QuerySet) – The original QuerySet of schedules to be filtered.
- Returns:
A refined QuerySet of schedules after applying the filter.
- Return type:
QuerySet
- class openedx_filters.learning.filters.StudentLoginRequested[source]#
Filter used to modify the login process of a given user in the LMS.
- Purpose:
This filter is triggered when a user tries to log in, just before the login process is completed allowing the filter to act on the user object.
- Filter Type:
org.openedx.learning.student.login.requested.v1
- Trigger:
Repository: openedx/openedx-platform
Path: openedx/core/djangoapps/user_authn/views/login.py
Function or Method: login_user
- exception PreventLogin(message: str, redirect_to: str = '', error_code: str = '', context: dict | None = None)[source]#
Raise to prevent the login process to continue.
This exception is propagated to the login view and handled by the view to stop the login process.
- message#
error message for the exception.
- Type:
str
- redirect_to#
URL to redirect to.
- Type:
str
- error_code#
error code for the exception.
- Type:
str
- context#
context dictionary to be used in the exception.
- Type:
dict
- class openedx_filters.learning.filters.StudentRegistrationRequested[source]#
Filter used to modify the registration process of a given user in the LMS.
- Purpose:
This filter is triggered when a user tries to register, just before the registration process is completed allowing the filter to act on the registration form data.
- Filter Type:
org.openedx.learning.student.registration.requested.v1
- Trigger:
Repository: openedx/openedx-platform
Path: openedx/core/djangoapps/user_authn/views/register.py
Function or Method: RegistrationView.post
- exception PreventRegistration(message: str = '', redirect_to: str = '', status_code: int | None = None, **kwargs)[source]#
Raise to prevent the registration process to continue.
This exception is propagated to the registration view and handled by the view to stop the registration process.
- classmethod run_filter(form_data: QueryDict) QueryDict[source]#
Process the registration form data using the configured pipeline steps to modify the registration process.
- Parameters:
form_data (QueryDict) – contains the request.data submitted by the registration form.
- Returns:
form data dictionary, possibly modified.
- Return type:
QueryDict
- class openedx_filters.learning.filters.VerticalBlockChildRenderStarted[source]#
Filter used to modify the rendering of a child block within a vertical block.
- Purpose:
This filter is triggered when a child block is about to be rendered within a vertical block, allowing the filter to act on the block and the context used to render the child block.
- Filter Type:
org.openedx.learning.vertical_block_child.render.started.v1
- Trigger:
Repository: openedx/openedx-platform
Path: xmodule/vertical_block.py
Function or Method: VerticalBlock._student_or_public_view
- exception PreventChildBlockRender(message: str = '', redirect_to: str = '', status_code: int | None = None, **kwargs)[source]#
Raise to prevent a child block from rendering.
This exception is propagated to the vertical block view and handled by the view to stop the rendering of the child block.
- classmethod run_filter(block: Any, context: dict[str, Any]) tuple[Any, dict[str, Any] | None][source]#
Process the block and context using the configured pipeline steps to modify the rendering of a child block.
- Parameters:
block (XBlock) – the XBlock that is about to be rendered into HTML
context (dict) – rendering context values like is_mobile_app, show_title..etc
- Returns:
XBlock: the XBlock that is about to be rendered into HTML
dict: rendering context values like is_mobile_app, show_title..etc
- Return type:
tuple[XBlock, dict]
- class openedx_filters.learning.filters.VerticalBlockRenderCompleted[source]#
Filter used to act on vertical block rendering completed.
- Purpose:
This filter is triggered when a vertical block is rendered, just after the rendering process is completed allowing the filter to act on the block, fragment, context, and view used to render the vertical block.
- Filter Type:
org.openedx.learning.vertical_block.render.completed.v1
- Trigger:
Repository: openedx/openedx-platform
Path: xmodule/vertical_block.py
Function or Method: VerticalBlock._student_or_public_view
- exception PreventVerticalBlockRender(message: str = '', redirect_to: str = '', status_code: int | None = None, **kwargs)[source]#
Raise to prevent the vertical block from rendering for the user.
This exception is propagated to the vertical block view and handled by the view to stop the rendering of the vertical block.
- classmethod run_filter(block: Any, fragment: Any, context: dict[str, Any], view: str) tuple[Any, Any, dict[str, Any] | None, str | None][source]#
Process the inputs using the configured pipeline steps to modify the rendering of a vertical block.
- Parameters:
block (VerticalBlock) – The VerticalBlock instance which is being rendered.
fragment (web_fragments.Fragment) – The web-fragment containing the rendered content of VerticalBlock.
context (dict) – rendering context values like is_mobile_app, show_title..etc.
view (str) – the rendering view. Can be either ‘student_view’, or ‘public_view’.
- Returns:
VerticalBlock: The VerticalBlock instance which is being rendered.
web_fragments.Fragment: The web-fragment containing the rendered content of VerticalBlock.
dict: rendering context values like is_mobile_app, show_title..etc.
str: the rendering view. Can be either ‘student_view’, or ‘public_view’.
- Return type:
tuple[VerticalBlock, web_fragments.Fragment, dict, str]
Authentication Subdomain#
Package where filters related to the authentication architectural subdomain are implemented.
- class openedx_filters.authentication.filters.AuthnMFEContextGenerated[source]#
Filter used to enrich or modify the authentication MFE context.
- Purpose:
This filter hooks into the modern authentication MFE (frontend-app-authn) flow. It is triggered just after the context served to the authentication micro-frontend has been generated, allowing pipeline steps to add or modify entries served to the MFE (e.g. branding data) based on external conditions. It is the MFE counterpart to LogistrationViewContextGenerated, which enriches the legacy server-rendered page’s nested context.
The context is split across two arguments because the caller may only know how to serve the entries it declares itself: pipeline steps modify entries the caller already declares through
context, and contribute entries the caller does not declare throughextra_context.- Filter Type:
org.openedx.authentication.mfe.context.generated.v1
- Trigger:
Repository: openedx/edx-platform
Path: openedx/core/djangoapps/user_authn/views/utils.py
Function or Method: get_mfe_context
- classmethod run_filter(context: dict, extra_context: dict) tuple[dict, dict][source]#
Process the context through the configured pipeline steps.
- Parameters:
context (dict) – the context dict served to the authentication MFE. Pipeline steps modify the entries the caller declares itself.
extra_context (dict) – additional entries to serve to the authentication MFE. Pipeline steps add entries the caller does not declare itself. The caller decides how these are merged into what it serves.
- Returns:
dict: the (possibly modified) context. dict: the (possibly populated) extra context.
- Return type:
tuple[dict, dict]
- class openedx_filters.authentication.filters.LoginAltRedirectURLRequested[source]#
Filter used to determine an alternative redirect URL after a successful login.
- Purpose:
This filter is triggered after a user has been authenticated, before the final redirect is issued. Any pipeline step may return an alternative redirect URL to send the user through additional post-login flows (e.g. an account-selection page).
- Filter Type:
org.openedx.authentication.login.alt_redirect_url.requested.v1
- Trigger:
Repository: openedx/edx-platform
Path: openedx/core/djangoapps/user_authn/views/login.py
Function or Method: login_user
- classmethod run_filter(redirect_url: str, user: Any) tuple[str, Any][source]#
Process the redirect URL through the configured pipeline steps.
- Parameters:
redirect_url (str) – the destination the caller intends to send the user to. A pipeline step that redirects elsewhere may attempt to preserve this URL by nesting it within another
/?next=layer to create a chain of URLs.user (User) – the authenticated Django user.
- Returns:
the (possibly modified) redirect URL and the user.
- Return type:
tuple[str, User]
- class openedx_filters.authentication.filters.LoginFormGenerated[source]#
Filter used to modify the login form description after it has been generated.
- Purpose:
This filter is triggered for every login form build, before the form fields are added. Pipeline steps may override field properties (e.g. defaults, visibility, restrictions). Field property overrides take effect when the fields are subsequently added, so steps run before field construction.
Pipeline steps can pass field overrides (enabling dynamic field hiding), but cannot add fields of their own. At the time of this writing, there is no supported mechanism for adding custom login fields. The registration form, however, does support custom fields via the
PROFILE_EXTENSION_FORMsetting (or the deprecatedREGISTRATION_EXTENSION_FORM) in platform.The third-party auth state of the request is passed alongside the form description so that pipeline steps can tailor the form to the provider the user is authenticating with, without having to resolve that state themselves.
- Filter Type:
org.openedx.authentication.login.form.generated.v1
- Trigger:
Repository: openedx/edx-platform
Path: openedx/core/djangoapps/user_authn/views/login_form.py
Function or Method: get_login_session_form
- classmethod run_filter(form_desc: FormDescriptionProtocol, running_pipeline: RunningPipeline | None, current_provider: ProviderConfigProtocol | None) tuple[FormDescriptionProtocol, RunningPipeline | None, ProviderConfigProtocol | None][source]#
Process the login form description through the configured pipeline steps.
- Parameters:
form_desc (FormDescriptionProtocol) – the login form description.
running_pipeline (RunningPipeline) – the third-party auth pipeline running for the request, or None when third-party auth is disabled or no pipeline is running.
current_provider (ProviderConfigProtocol) – the provider associated with the running pipeline, or None when there is no running pipeline or the provider could not be determined.
- Returns:
the (possibly modified) form description, the running pipeline, and the current provider.
- Return type:
tuple[FormDescriptionProtocol, RunningPipeline | None, ProviderConfigProtocol | None]
- class openedx_filters.authentication.filters.LogistrationViewContextGenerated[source]#
Filter used to enrich or modify the combined login-and-registration page context.
- Purpose:
This filter hooks into the legacy (server-rendered) login/registration flow. It is triggered just after the combined login/registration page context has been generated and just before the page is rendered, allowing pipeline steps to modify the context dict (e.g. alter sidebar content) based on external conditions.
- Filter Type:
org.openedx.authentication.logistration_view.context.generated.v1
- Trigger:
Repository: openedx/edx-platform
Path: openedx/core/djangoapps/user_authn/views/login_form.py
Function or Method: login_and_registration_form
- class openedx_filters.authentication.filters.LogistrationViewRenderCompleted[source]#
Filter used to modify the rendered login/registration page response.
- Purpose:
This filter hooks into the legacy (server-rendered) login/registration flow. It is triggered right after the combined login/registration page has been rendered, allowing pipeline steps to modify the response (e.g. set or delete cookies, add headers) using the final page context.
- Filter Type:
org.openedx.authentication.logistration_view.render.completed.v1
- Trigger:
Repository: openedx/edx-platform
Path: openedx/core/djangoapps/user_authn/views/login_form.py
Function or Method: login_and_registration_form
- classmethod run_filter(response: Any, context: dict) tuple[Any, dict][source]#
Process the response and context through the configured pipeline steps.
- Parameters:
response (HttpResponse) – the rendered login/registration page response.
context (dict) – the template context dict used to render the page.
- Returns:
the (possibly modified) response and the context.
- Return type:
tuple[HttpResponse, dict]
- class openedx_filters.authentication.filters.RegistrationFormGenerated[source]#
Filter used to modify the registration form description after it has been generated.
- Purpose:
This filter is triggered for every registration form build, before the form fields are added. Pipeline steps may override field properties (e.g. defaults, visibility, restrictions). Field property overrides take effect when the fields are subsequently added, so steps run before field construction.
Pipeline steps can pass field overrides (enabling dynamic field hiding), but cannot add fields of their own. If you need to add fields instead, use the
PROFILE_EXTENSION_FORMsetting (or the deprecatedREGISTRATION_EXTENSION_FORM) in platform.The third-party auth state of the request is passed alongside the form description so that pipeline steps can tailor the form to the provider the user is registering through, without having to resolve that state themselves.
- Filter Type:
org.openedx.authentication.registration.form.generated.v1
- Trigger:
Repository: openedx/edx-platform
Path: openedx/core/djangoapps/user_authn/views/registration_form.py
Function or Method: RegistrationFormFactory.get_registration_form
- classmethod run_filter(form_desc: FormDescriptionProtocol, running_pipeline: RunningPipeline | None, current_provider: ProviderConfigProtocol | None) tuple[FormDescriptionProtocol, RunningPipeline | None, ProviderConfigProtocol | None][source]#
Process the registration form description through the configured pipeline steps.
- Parameters:
form_desc (FormDescriptionProtocol) – the registration form description.
running_pipeline (RunningPipeline) – the third-party auth pipeline running for the request, or None when third-party auth is disabled or no pipeline is running.
current_provider (ProviderConfigProtocol) – the provider associated with the running pipeline, or None when there is no running pipeline or the provider could not be determined.
- Returns:
the (possibly modified) form description, the running pipeline, and the current provider.
- Return type:
tuple[FormDescriptionProtocol, RunningPipeline | None, ProviderConfigProtocol | None]
Some of these filters hand their pipeline steps payloads whose shape is declared as a structural type, so that steps do not couple to a concrete platform implementation:
Structural types shared by filters in the authentication subdomain.
These declare the shape of the payloads that filters in this subdomain pass to their pipeline steps, so that both the caller producing them and the pipeline step consuming them can be checked against a single shared definition:
the
TypedDictdeclarations describe the mappings the filters pass along, andthe structural (PEP 544)
Protocoldeclarations describe the minimal surface of the objects the filters pass along, without coupling the filters to any concrete platform implementation.
- class openedx_filters.authentication.types.FormDescriptionProtocol(*args, **kwargs)[source]#
Structural interface of the FormDescription object passed to the form-override filters.
Only the minimal surface consumed by pipeline steps is declared here. Pipeline steps should not rely on anything beyond this protocol.
This protocol is deliberately limited to overriding the properties of fields the caller already defines. Adding new registration fields is instead the job of the
PROFILE_EXTENSION_FORMsetting (or the deprecatedREGISTRATION_EXTENSION_FORM) in platform settings, which covers ingestion, persistence, and ordering. Custom login fields, however, cannot be added at the time of this writing.
- class openedx_filters.authentication.types.ProviderConfigProtocol(*args, **kwargs)[source]#
Structural interface of the third-party auth provider configuration.
Only the minimal surface consumed by pipeline steps is declared here. Pipeline steps should not rely on anything beyond this protocol.
- get_register_form_data(pipeline_kwargs: RunningPipelineKwargs, /) dict[source]#
Return the registration form field values prefilled by the provider.
- class openedx_filters.authentication.types.RunningPipeline[source]#
Shape of the authentication pipeline state for a request.
This is the payload that the login and registration form filters pass to their pipeline steps to describe the authentication attempt in flight, so that steps can tailor the form to the provider the user is authenticating with.
Unlike its
kwargsmember, this mapping is built by its caller as a complete literal with exactly these two keys, so it is declared with both of them required: adding, omitting or misspelling a key is an error on the caller’s side.backendnames the authentication backend driving the attempt, andkwargsholds the keyword arguments the pipeline has accumulated so far.
- class openedx_filters.authentication.types.RunningPipelineKwargs[source]#
Partial shape of a paused authentication pipeline’s accumulated keyword arguments.
detailsandresponseare the only two keys that may be accessed unconditionally; the rest should be read with.get(), because their values depend on how far the pipeline had progressed
Maintenance chart
Review Date |
Reviewer |
Release |
Test situation |
2025-02-13 |
Maria Grimaldi |
Sumac |
Pass. |