fix: simplify unlinked-learner exclusion in the Learner Progress Report - #704
Open
sjasti-sonata-svg wants to merge 1 commit into
Open
Conversation
Replaces the Q(is_linked=True) | Q(enterprise_user__isnull=True, is_consent_granted=False) filter with a plain .exclude() on is_linked=False. Equivalent for every case in current data (both excluded genuinely-unlinked learners and include non-DSC enrollments identically), with simpler code at the cost of an explicit guard against the theoretical case of a NULL enterprise_user with consent granted -- not expected to occur given current warehouse ETL behavior. [ENT-12136]
sjasti-sonata-svg
force-pushed
the
fix/ent-12136-exclude-unlinked-refinement
branch
from
August 6, 2026 07:38
ebd5bd0 to
97091ae
Compare
rgopalrao-sonata-png
approved these changes
Aug 6, 2026
Comment on lines
+105
to
+106
| ).exclude( | ||
| enterprise_user__is_linked=False, |
Contributor
There was a problem hiding this comment.
Have we confirmed that is_consent_granted=False users also have is_linked=True? The previous implementation seemed to be operating under a different assumption.
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
Follow-up to #703. Simplifies the queryset filter in
EnterpriseLearnerEnrollmentViewSet.get_queryset():Test plan
test_get_queryset_adds_placeholder_metadata_columnsmock assertions for the.exclude()call.test_list_includes_non_consented_enrollments_with_no_enterprise_userandtest_list_excludes_non_consented_enrollments_of_genuinely_unlinked_learners(from fix: keep non-DSC enrollments visible in the Learner Progress Report #703) both still pass unchanged, confirming behavior is identical for the ticket's real scenarios.