diff --git a/openedx_filters/learning/filters.py b/openedx_filters/learning/filters.py index d789f60..029cbb2 100644 --- a/openedx_filters/learning/filters.py +++ b/openedx_filters/learning/filters.py @@ -1,11 +1,51 @@ """ Package where filters related to the learning architectural subdomain are implemented. """ + from openedx_filters.exceptions import OpenEdxFilterException from openedx_filters.tooling import OpenEdxPublicFilter from openedx_filters.utils import SensitiveDataManagementMixin +class AccountSettingsRenderStarted(OpenEdxPublicFilter): + """ Custom class used to create Account settings filters. """ + + filter_type = "org.openedx.learning.student.settings.render.started.v1" + + @classmethod + def run_filter(cls, context): + """ + Execute a filter with the signature specified. + + Arguments: + context (dict): context for the account settings page. + """ + data = super().run_pipeline(context=context) + context = data.get("context") + return context + + +class StudentRegistrationRenderStarted(OpenEdxPublicFilter): + """ + Custom class used to add custom fields to the registration form. + """ + + filter_type = "org.openedx.learning.student.registration.render.started.v1" + + @classmethod + def run_filter(cls, form_desc): + """ + Execute a filter with the signature specified. + + Arguments: + form_desc (dict): description form specifying the fields to be rendered + in the registration form. + """ + data = super().run_pipeline(form_desc=form_desc) + form_data = data.get("form_desc") + return form_data + + class StudentRegistrationRequested(OpenEdxPublicFilter, SensitiveDataManagementMixin): """ Custom class used to create registration filters and its custom methods.