Commit 50961fe5 by arbisoft

ECOM-528 code refactoring

parent 4dfabe9e
......@@ -760,17 +760,8 @@ def _allow_donation(course_modes, course_id, enrollment):
"""
donations_enabled = DonationConfiguration.current().enabled
is_verified_mode = CourseMode.has_verified_mode(course_modes[course_id])
has_payment_option = CourseMode.has_payment_options(course_id)
return_val = False
if donations_enabled:
if not is_verified_mode:
if not has_payment_option:
return_val = True
else:
if enrollment.mode in ['audit', 'honor']:
return_val = True
return return_val
return donations_enabled and enrollment.mode in course_modes[course_id] and \
course_modes[course_id][enrollment.mode].min_price == 0
def try_change_enrollment(request):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment