I am using tutor
tutor, version 14.0.3
- nutmeg
Which enroll method you are referring to, please clarify. The one in data.py?
app@0c73994f3662:~/edx-platform/openedx/core/djangoapps/enrollments$ pwd
/openedx/edx-platform/openedx/core/djangoapps/enrollments
app@0c73994f3662:~/edx-platform/openedx/core/djangoapps/enrollments$ grep -ir "check_access" .
./api.py: enrollment = _data_api().create_course_enrollment(username, course_id, mode, is_active, enterprise_uuid, check_access=False)
./data.py: enrollment = CourseEnrollment.enroll(user, course_key, check_access=True, enterprise_uuid=enterprise_uuid)
I am using below script, tried with skip-checks but same error.
app@0c73994f3662:~/edx-platform$ ./manage.py lms --settings production enroll_user_in_course --help
optional arguments:
-h, --help show this help message and exit
-e EMAIL, --email EMAIL
Email for user
-c COURSE, --course COURSE
course ID to enroll the user in
-m MODE, --mode MODE course mode to enroll the user in
--version show program's version number and exit
-v {0,1,2,3}, --verbosity {0,1,2,3}
Verbosity level; 0=minimal output, 1=normal output, 2=verbose output, 3=very verbose output
--settings SETTINGS The Python path to a settings module, e.g. "myproject.settings.main". If this isn't provided, the DJANGO_SETTINGS_MODULE environment variable will be used.
--pythonpath PYTHONPATH
A directory to add to the Python path, e.g. "/home/djangoprojects/myproject".
--traceback Raise on CommandError exceptions
--no-color Don't colorize the command output.
--force-color Force colorization of the command output.
--skip-checks Skip system checks.
method which is being called in api.py
def add_enrollment(username, course_id, mode=None, is_active=True, enrollment_attributes=None, enterprise_uuid=None):
"""Enrolls a user in a course.
...
validate_course_mode(course_id, mode, is_active=is_active)
enrollment = _data_api().create_course_enrollment(username, course_id, mode, is_active, enterprise_uuid, check_access=False)