Skip to content

Commit

Permalink
feat: add force enrollment for csv upload
Browse files Browse the repository at this point in the history
  • Loading branch information
tecoholic committed May 9, 2023
1 parent fdac6f5 commit 49ea86a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
3 changes: 2 additions & 1 deletion enterprise/admin/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,8 @@ def post(self, request, customer_uuid):
notify=notify,
enrollment_reason=manual_enrollment_reason,
sales_force_id=sales_force_id,
discount=discount
discount=discount,
force_enrollment=force_enrollment,
)

# Redirect to GET if everything went smooth.
Expand Down
11 changes: 11 additions & 0 deletions enterprise/static/enterprise/js/manage_learners.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,17 @@ function loadPage() {
programEnrollment.$control.oldValue = null;
});

$("#id_bulk_upload_csv").change(function(e) {
if (e.target.value) {
var force_enrollment = $("#id_force_enrollment");
force_enrollment.parent().show();
force_enrollment.siblings(".helptext")[0].innerHTML = gettext(
"If any of the courses in the CSV file are marked 'Invite Only', " +
"this should be enabled for the enrollments to go through in those courses."
);
}
});

if (courseEnrollment.$control.val()) {
courseEnrollment.$control.trigger("input");
} else if (programEnrollment.$control.val()) {
Expand Down

0 comments on commit 49ea86a

Please sign in to comment.