🐛(backend) skip hidden course runs from state calculation #2561
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes a bug of state calculation for related courses. On the state property skip course runs with
catalog_visibility
as hidden.Purpose
We at NAU idenfied a bug related to the course run state calculation.
As it is possible to see, the following course presents Feb 2025 as the start, but this course is hidden. This happens on all the pages that show related courses.
Organization detail page
Course page
Course search
Course page on edit mode
Conclusion
The sequence of images shows that, in the course search page the behavior is as expected, it does not show hidden courses, but when it comes to showing related courses, the hidden ones are being considered. This PR excludes from the query the hidden ones, without impacting on the other places that list course runs, such as in the course page admin.