Skip to content

feat: replace DSC decorator and enterprise imports in courseware#38102

Draft
pwnage101 wants to merge 1 commit intomasterfrom
pwnage101/ENT-11544
Draft

feat: replace DSC decorator and enterprise imports in courseware#38102
pwnage101 wants to merge 1 commit intomasterfrom
pwnage101/ENT-11544

Conversation

@pwnage101
Copy link
Contributor

@pwnage101 pwnage101 commented Mar 5, 2026

  • Create lms/djangoapps/courseware/decorators.py with courseware_view_redirect decorator that calls CoursewareViewRedirectURL filter and redirects to the first URL in the result list, if non-empty.
  • Replace data_sharing_consent_required with courseware_view_redirect in CoursewareIndex, CourseTabView, progress, and course_wiki_redirect.
  • Replace get_enterprise_consent_url with CoursewareViewRedirectURL filter call in WikiAccessMiddleware.
  • Remove enterprise.models module-level import from access_utils.py; replace enterprise_learner_enrolled with _get_courseware_redirect_url (filter-based helper); update check_data_sharing_consent to use filter; move enterprise model imports to local scope in check_correct_active_enterprise_customer.
  • Add OPEN_EDX_FILTERS_CONFIG with CoursewareViewRedirectURL entry in lms/envs/common.py.
  • Update tests to mock CoursewareViewRedirectURL.run_filter instead of enterprise functions.

ENT-11544


Blocked by:

- Create lms/djangoapps/courseware/decorators.py with courseware_view_redirect
  decorator that calls CoursewareViewRedirectURL filter and redirects to the
  first URL in the result list, if non-empty.
- Replace data_sharing_consent_required with courseware_view_redirect in
  CoursewareIndex, CourseTabView, progress, and course_wiki_redirect.
- Replace get_enterprise_consent_url with CoursewareViewRedirectURL filter
  call in WikiAccessMiddleware.
- Remove enterprise.models module-level import from access_utils.py;
  replace enterprise_learner_enrolled with _get_courseware_redirect_url
  (filter-based helper); update check_data_sharing_consent to use filter;
  move enterprise model imports to local scope in
  check_correct_active_enterprise_customer.
- Add OPEN_EDX_FILTERS_CONFIG with CoursewareViewRedirectURL entry in
  lms/envs/common.py.
- Update tests to mock CoursewareViewRedirectURL.run_filter instead of
  enterprise functions.

ENT-11544
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant