fix: check enrollment status before issuing Learning Path credentials#93
Merged
Agrendalath merged 6 commits intomainfrom May 5, 2025
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR fixes the issuance of Learning Path credentials by verifying that users are actively enrolled in the Learning Path before processing completion and grade data. Key changes include:
- Filtering out users not enrolled (with an active enrollment) in the Learning Path in the processor.
- Updating tests to simulate learning path enrollment and verify the new behavior.
- Bumping dependency versions and updating the package version in the module’s init.
Reviewed Changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tests/test_processors.py | Updated fixtures and tests to incorporate enrollment checks and adjust expected results. |
| requirements/.txt and requirements/ | Multiple dependency version bumps, including the learning-paths-plugin update and others. |
| learning_credentials/processors.py | Added filtering logic to exclude users without an active enrollment from eligibility. |
| learning_credentials/init.py | Updated module version from 0.2.0 to 0.2.1. |
Files not reviewed (1)
- CHANGELOG.rst: Language not supported
Comments suppressed due to low confidence (1)
tests/test_processors.py:362
- The test 'test_retrieve_data_for_learning_path' does not enroll any users into the learning path, meaning the enrollment check in _process_learning_context will cause the result to be empty. Please add enrollment for the expected users before calling the processor to ensure the test accurately reflects the new behavior.
def test_retrieve_data_for_learning_path(
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 adds Learning Path enrollment checks implemented in open-craft/learning-paths-plugin#19.
Private-ref: BB-9669