Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When creating enrollment set is_active explicitly in the enrollment api call #2300

Merged
merged 7 commits into from
Jul 31, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions openedx/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,7 @@ def enroll_in_edx_course_runs(
mode=mode,
username=username,
force_enrollment=force_enrollment,
enrollment_attributes={"name": "is_active", "value": True},
Copy link
Contributor

@arslanashraf7 arslanashraf7 Jul 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think setting is_active in enrollment_attributes would not work. We will need to send is_active as an independent key in the post data.

Here are some of the details behind:

If we take a look at this enrollment code in Open edX you will notice that they are getting the is_active key right from the post data field and not the enrollment_attributes. So, I think this change would not do the trick for us.

In my opinion here is what we would need to do:

  1. Allow create_student_enrollment to take an is_active attr which can be True by default
  2. Add is_active in enrollment_data
  3. Update the usages of create_student_enrollment in MITx Online project as per needs.

)
results.append(enrollment)
except HTTPError as exc: # noqa: PERF203
Expand Down
Loading