Skip to content

Commit

Permalink
fix: valitade enrollment for programs (#42)
Browse files Browse the repository at this point in the history
* fix: valitade enrollment for programs

* style: fixing code
  • Loading branch information
ErickMurillo authored Jun 21, 2023
1 parent b3963ce commit c4711a9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion eox_hooks/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,13 @@ def trigger_enrollments_creation(**kwargs):

if not followup_enrollments:
return
followup_list = []
for enroll in followup_enrollments:
if str(enrollment.course.course_key) != enroll['course_id']:
followup_list.append(enroll)

create_enrollments_for_program.delay(
enrollment.user.pii.username, followup_enrollments,
enrollment.user.pii.username, followup_list,
)


Expand Down
4 changes: 2 additions & 2 deletions eox_hooks/tests/test_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def test_enroll_for_program(self, get_course, create_enroll_task):
other_course_settings = {
"EDNX_TRIGGER_FOLLOWUP_ENROLLMENTS": [
{
"course_id": "course-v1:edX+DemoX+Demo_Course",
"course_id": "course-v1:edX+Demo123+Demo_Course",
},
],
}
Expand All @@ -179,7 +179,7 @@ def test_enroll_for_program(self, get_course, create_enroll_task):
"test",
[
{
"course_id": "course-v1:edX+DemoX+Demo_Course",
"course_id": "course-v1:edX+Demo123+Demo_Course",
},
],
)
Expand Down

0 comments on commit c4711a9

Please sign in to comment.