Skip to content

Commit 697701e

Browse files
committed
break: Reintroduce multi-redemption bug.
1 parent f164f0d commit 697701e

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

docs/manual-test-plan.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,7 @@ Log in to the web UI as the "apicreated1@example.com" user
568568
(username "apicreated4"; sorry, that's confusing; password "newpassword"),
569569
and verify the user is enrolled in the Open edX Demo Course.
570570

571+
**NOTE: This next test, for reusing an enrollment code, will fail. You will be able to reuse the code even though you should not be able to. See [this PR](https://github.com/open-craft/legacy-appsembler-api/pull/5) for details.**
571572

572573
Test enrolling again with the same code:
573574

shoppingcart/views.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -468,14 +468,13 @@ def post(self, request):
468468
user_is_valid = False
469469
error_reason = "User not found"
470470
try:
471-
reg_code_is_valid, reg_code_already_redeemed, course_registration = get_reg_code_validity(enrollment_code)
471+
reg_code_is_valid, _reg_code_already_redeemed, course_registration = get_reg_code_validity(enrollment_code)
472472
except Http404:
473473
# only count toward the rate limiting if it was an invalid code
474474
is_ratelimited(request, key="user", group="enrollment-codes.enroll-user", rate="6/m", increment=True)
475475
reg_code_is_valid = False
476-
reg_code_already_redeemed = False
477476
error_reason = "Enrollment code not found"
478-
if user_is_valid and reg_code_is_valid and not reg_code_already_redeemed:
477+
if user_is_valid and reg_code_is_valid:
479478
course = get_course_by_id(course_registration.course_id, depth=0)
480479
redemption = RegistrationCodeRedemption.create_invoice_generated_registration_redemption(
481480
course_registration, user

0 commit comments

Comments
 (0)