Skip to content

Conversation

@jignaciopm
Copy link
Contributor

Description

This pull request enhances the prerequisite course serialization in the learner home API by adding a new field that provides detailed information about unmet prerequisites. It introduces a new serializer method to return a list of prerequisite courses not yet completed, including their display names and URLs, and adds corresponding unit tests to ensure correct behavior.

Prerequisite course serialization improvements:

  • Added a new serializer field hasUnmetPrerequisitesList to CoursewareAccessSerializer, which returns detailed info for each unmet prerequisite course, including display name, course home URL, and about page URL. [1] [2]
  • Implemented the helper method _get_course_about_url_for_key to reliably generate the course about page URL, handling cases where the course overview does not exist.

Testing enhancements:

  • Added unit tests to verify that hasUnmetPrerequisitesList returns an empty list when there are no unmet prerequisites and correctly serializes prerequisite course info when present.

Dependency and import updates:

  • Imported new helper functions and models (get_link_for_about_page, get_pre_requisite_courses_not_completed, CourseOverview) to support the new functionality.

Supporting information

openedx/frontend-app-learner-dashboard#753

Testing instructions

  • Create a simple course in Studio.
  • Go to "Advanced settings" and set "Enable subsection prerequisites" ON (true).
  • Go to "Schedule & details" and set in "Prerequisite course" whatever you want.
  • Check the /api/learner_home/init endpoint. Locate your created course and find the attribute hasUnmetPrerequisitesList. You will see the following information:
"hasUnmetPrerequisitesList": [
    {
        "display": "PruebaReq1 PruebaReq1",
        "url": "http://apps.local.openedx.io:2000/learning/course/course-v1:PruebaReq1+PruebaReq1+PruebaReq1/home",
        "about_url": "http://local.openedx.io:8000/courses/course-v1:PruebaReq1+PruebaReq1+PruebaReq1/about"
    },
    {
        "display": "Another Course Another Org",
        "about_url": "https://google.com/"
    }
]

Deadline

"None" if there's no rush, or provide a specific date or event (and reason) if there is one.

@jignaciopm jignaciopm requested a review from a team as a code owner December 16, 2025 02:19
@openedx-webhooks
Copy link

Thanks for the pull request, @jignaciopm!

This repository is currently maintained by @openedx/wg-maintenance-edx-platform.

Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review.

🔘 Get product approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.

Details
Where can I find more information?

If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:

When can I expect my changes to be merged?

Our goal is to get community contributions seen and reviewed as efficiently as possible.

However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Dec 16, 2025
@github-project-automation github-project-automation bot moved this to Needs Triage in Contributions Dec 16, 2025
@mphilbrick211 mphilbrick211 moved this from Needs Triage to Ready for Review in Contributions Dec 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

open-source-contribution PR author is not from Axim or 2U

Projects

Status: Ready for Review

Development

Successfully merging this pull request may close these issues.

2 participants