chore: add missing inline code annotations in filters (#36474)

This commit is contained in:
Bryann Valderrama
2025-07-18 10:53:51 -05:00
committed by GitHub
parent 789bc36378
commit 2a1d1debad
3 changed files with 10 additions and 2 deletions

View File

@@ -147,7 +147,9 @@ class CourseRunSerializer(serializers.Serializer):
def to_representation(self, instance):
"""Serialize the courserun instance to be able to update the values before the API finishes rendering."""
serialized_courserun = super().to_representation(instance)
serialized_courserun = CourseRunAPIRenderStarted().run_filter(
# .. filter_implemented_name: CourseRunAPIRenderStarted
# .. filter_type: org.openedx.learning.home.courserun.api.rendered.started.v1
serialized_courserun = CourseRunAPIRenderStarted.run_filter(
serialized_courserun=serialized_courserun,
)
return serialized_courserun
@@ -264,7 +266,9 @@ class EnrollmentSerializer(serializers.Serializer):
def to_representation(self, instance):
"""Serialize the enrollment instance to be able to update the values before the API finishes rendering."""
serialized_enrollment = super().to_representation(instance)
course_key, serialized_enrollment = CourseEnrollmentAPIRenderStarted().run_filter(
# .. filter_implemented_name: CourseEnrollmentAPIRenderStarted
# .. filter_type: org.openedx.learning.home.enrollment.api.rendered.v1
course_key, serialized_enrollment = CourseEnrollmentAPIRenderStarted.run_filter(
course_key=instance.course_id,
serialized_enrollment=serialized_enrollment,
)

View File

@@ -595,6 +595,8 @@ def login_user(request, api_version="v1"): # pylint: disable=too-many-statement
possibly_authenticated_user = user
try:
# .. filter_implemented_name: StudentLoginRequested
# .. filter_type: org.openedx.learning.student.login.requested.v1
possibly_authenticated_user = StudentLoginRequested.run_filter(user=possibly_authenticated_user)
except StudentLoginRequested.PreventLogin as exc:
raise AuthFailedError(

View File

@@ -593,6 +593,8 @@ class RegistrationView(APIView):
data['username'] = get_auto_generated_username(data)
try:
# .. filter_implemented_name: StudentRegistrationRequested
# .. filter_type: org.openedx.learning.student.registration.requested.v1
data = StudentRegistrationRequested.run_filter(form_data=data)
except StudentRegistrationRequested.PreventRegistration as exc:
errors = {