feat: new enrollment by domain system #93
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.
Related Issue: https://github.com/fccn/nau-technical/issues/580
Enrollment by Domain Filter
This new feature in nau-openedx-extensions allows restricting course enrollment based on user email domains. It integrates with the
openedx-filtersframework to automatically validate domains during the enrollment process.Features
Quick Start
1. Configure OpenEdX Filters
Add to your Tutor plugin configuration:
2. Create Domain List
# Basic import with minimal options python manage.py lms import_enrollment_domains example_domains.txt university-partnersNote: You must use the files relative or absolute path, example: ../extra/nau-openedx-extensions/nau_openedx_extensions/enrollment_by_domain/example_domains.txt
3. Configure Course
In Studio → Advanced Settings → Other Course Settings:
{ "filter_enrollment_allowed_list_code": "university-partners" }Domain Management
Import Command Syntax
Command Options
--description "text"--custom-message "text"Domain File Format
Usage Examples
Basic Usage
Example 1: University Partners
Course Configuration in Studio:
{ "filter_enrollment_allowed_list_code": "university-partners" }Example 2: Corporate Training Program
Example 3: Multiple Domain Lists
Example 4: Adding More Domains
Note: The command only adds new domains. Existing domains are preserved and duplicates are automatically skipped.
Course Configuration
Enable Filter for a Course
{ "filter_enrollment_allowed_list_code": "your-list-code" }Custom Error Messages
Option 1: List-level message (affects all courses using this list)
python manage.py lms import_enrollment_domains domains.txt my-list --custom-message "Contact support@example.com for enrollment assistance."Option 2: Course-level message (overrides list message for this course)
{ "filter_enrollment_allowed_list_code": "my-list", "filter_enrollment_by_domain_custom_exception_message": "This course is restricted to university partners only." }If the custom exception message is not defined, it will use a default message
Priority Order for Error Messages
Command Output Examples
New List Creation
Adding to Existing List
No Changes Needed
How It Works
Filter Activation
org.openedx.learning.course.enrollment.started.v1filter_enrollment_allowed_list_codeconfiguredDjango Admin Management
Access domain management through Django Admin:
/admin/Best Practices
university-partners, notlist1)