fix: keep non-DSC enrollments visible in the Learner Progress Report - #703
Merged
marlonkeating merged 2 commits intoAug 4, 2026
Merged
Conversation
sjasti-sonata-svg
force-pushed
the
fix/cr-8194-lpr-non-dsc-enrollments
branch
2 times, most recently
from
August 4, 2026 06:52
1086948 to
ef08596
Compare
The is_linked=True filter added to exclude unlinked learners also scrubbed non-DSC enrollments, since both cases null out the enterprise_user link. Enrollments without granted consent should still appear in the LPR with is_consent_granted=False, not disappear entirely. [ENT-12136]
sjasti-sonata-svg
force-pushed
the
fix/cr-8194-lpr-non-dsc-enrollments
branch
from
August 4, 2026 09:06
ef08596 to
e4d8f59
Compare
| enterprise_user__is_linked=True, | ||
| mock_filter.assert_called_once_with(enterprise_customer_uuid=self.enterprise_id) | ||
| enrollments.filter.assert_called_once_with( | ||
| Q(enterprise_user__is_linked=True) | Q(enterprise_user__isnull=True, is_consent_granted=False) |
Contributor
There was a problem hiding this comment.
check one use case where enterprise_user IS NULL and is_consent_granted=False
Contributor
Author
There was a problem hiding this comment.
Noted and it is already covered .
rgopalrao-sonata-png
approved these changes
Aug 4, 2026
marlonkeating
approved these changes
Aug 4, 2026
This was referenced Aug 5, 2026
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.
JIRA: https://2u-internal.atlassian.net/browse/ENT-12136
Summary
enterprise_user__is_linked=Truefilter added toEnterpriseLearnerEnrollmentViewSet.get_queryset()to exclude unlinked learners from the LPR also silently excluded enrollments without granted Data Sharing Consent (DSC), since both cases null out theenterprise_userlink the same way.is_consent_granted=False, not disappear entirely.Q(enterprise_user__is_linked=True) | Q(enterprise_user__isnull=True, is_consent_granted=False). This narrows the "show it anyway" carve-out to only the true scrubbed case (enterprise_useris NULL, no learner association at all) rather than any non-consented enrollment regardless of link state -- so a genuinely unlinked learner (a realEnterpriseLearnerrow withis_linked=False) stays excluded even if their enrollment also happens to lack consent.overview()analytics endpoint, since it reuses the same queryset.Test plan
test_get_queryset_adds_placeholder_metadata_columnsmock assertions for the new two-step filter chain.test_list_includes_non_consented_enrollments_with_no_enterprise_userreproducing the reported scenario (enterprise_user is NULL).test_list_excludes_non_consented_enrollments_of_genuinely_unlinked_learnerscovering the case where a real, is_linked=False learner exists -- confirms it still stays excluded even without consent.test_list_excludes_enrollments_of_unlinked_learnersandtest_overview_number_of_users_excludes_unlinked_learnersstill pass.