mitodl / mitxonline

BSD 3-Clause "New" or "Revised" License
4 stars 2 forks source link

Add get_dated_courseruns function for availability to check for dated courses #2354

Closed JenniWhitman closed 3 weeks ago

JenniWhitman commented 3 weeks ago

What are the relevant tickets?

Fixes https://github.com/mitodl/hq/issues/5260

Description (What does it do?)

Rather than relying on the adverse, this PR adds a gunction, get_dated_courseruns, to get any dated, enrollable courseruns for the course being serialized. I've also added a test to this effect. This will generate the correct availability as we defined dated as having 1 or more dated courseruns, regardless of whether they also had archived or self-paced courses.

How can this be tested?

Create courseruns that are both enrollable and not, self-paced and not and you should still see dated as long as one is both enrollable and not self-paced.