ECOM-3706: Restricted the enrollment in credit modes directly in upgradeAndVerified flow

This commit is contained in:
aamir-khan
2016-02-13 02:35:14 +05:00
committed by Adam Palay
parent 52b39ca4f5
commit f7be42a135

View File

@@ -522,9 +522,9 @@ class PayAndVerifyView(View):
if mode.min_price > 0 and not CourseMode.is_credit_mode(mode):
return mode
# Otherwise, find the first expired mode
# Otherwise, find the first non credit expired paid mode
for mode in all_modes[course_key]:
if mode.min_price > 0:
if mode.min_price > 0 and not CourseMode.is_credit_mode(mode):
return mode
# Otherwise, return None and so the view knows to respond with a 404.