mitodl / mitxonline

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

Filter relevant course runs to be live #2244

Closed annagav closed 1 month ago

annagav commented 1 month ago

What are the relevant tickets?

Fix https://github.com/mitodl/hq/issues/4493

Description (What does it do?)

Filter relevant course runs to be live

How can this be tested?

Test course about page,for courses that might have a no runs open for enrollments, and runs that are open but no longer live. Both cases should show the same view. They should not appear in the catalog. Nothing else should break.

annagav commented 1 month ago

@collinpreston So the current definition of is_enrollable is not comprehensive enough, there are few more checks that could be added to it.

For now I removed some unnecessary annotations from relevant course runs and refactored the code a bit.

I think we could put an effort into creating a universal filter for "valid", "enrollable" "live" run, that would be used in the catalog and about page.