Skip to content

Commit

Permalink
Enrollment request make sure not enrolled (#2149)
Browse files Browse the repository at this point in the history
  • Loading branch information
annagav authored Apr 4, 2024
1 parent aea496b commit 7813f2a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion courses/views/v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,12 @@ def _validate_enrollment_post_request(
max_age=USER_MSG_COOKIE_MAX_AGE,
)
return resp, None, None
if PaidCourseRun.fulfilled_paid_course_run_exists(user, run):
if (
PaidCourseRun.fulfilled_paid_course_run_exists(user, run)
or CourseRunEnrollment.objects.filter(
user=user, run=run, change_status=None
).exists()
):
resp = redirect_with_user_message(
reverse("user-dashboard"),
{"type": USER_MSG_TYPE_ENROLL_DUPLICATED},
Expand Down

0 comments on commit 7813f2a

Please sign in to comment.