Skip to content

Only return enrollable course runs#3378

Draft
cp-at-mit wants to merge 6 commits intomainfrom
only-return-enrollable-course-runs
Draft

Only return enrollable course runs#3378
cp-at-mit wants to merge 6 commits intomainfrom
only-return-enrollable-course-runs

Conversation

@cp-at-mit
Copy link
Copy Markdown
Contributor

What are the relevant tickets?

https://github.com/mitodl/hq/issues/10496

Description (What does it do?)

Adds a filter to only return enrollable course runs as part of the response from CourseWithCourseRunsSerializer

How can this be tested?

Create a course with two course runs, one in the past and one currently open for enrollment. Visit the catalog page and verify that the start date is for the course run that's currently open for enrollment.

Restrict CourseWithCourseRunsSerializer.get_courseruns to use the prefetched course runs filtered by .enrollable(), so only currently enrollable runs are returned while preserving prefetched product relations. Existing handling for org_id in the serializer context is unchanged.
@github-actions
Copy link
Copy Markdown

OpenAPI Changes

Show/hide ## Changes for v0.yaml:
## Changes for v0.yaml:


## Changes for v1.yaml:


## Changes for v2.yaml:


Unexpected changes? Ensure your branch is up-to-date with main (consider rebasing).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant