Skip to content

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

Draft
pwnage101 wants to merge 1 commit into
masterfrom
pwnage101/ENT-11544
Draft

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

Conversation

@pwnage101
Copy link
Copy Markdown
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:

…t-date validation, and course access checks

* Instead of an enterprise-specific view decorator conditionally
  redirecting learners to a consent view, plugins can now hook into the
  CoursewareViewStarted filter to redirect anywhere.
* Instead of enterprise-specific logic throwing an enterprise-specific
  start date validation error, CourseStartDateValidationFailed filter
  can now be used by plugins to throw a generic start date error.
* Instead of enterprise/consent-specific access checks baked into
  check_course_access, the CoursewareAccessChecksRequested filter lets
  plugins deny courseware access with a generic priority access error.

ENT-11544

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@pwnage101 pwnage101 force-pushed the pwnage101/ENT-11544 branch from 87650d5 to f09f36f Compare May 15, 2026 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enterprise An enterprise-related change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant