fix: prevent 500 error when course mode currency is not the same as the one configured in settings (#31312)
This commit solves the http 500 error when course concurrency is setted different for PAID_COURSE_REGISTRATION_CURRENCY and course modes.
This commit is contained in:
@@ -774,7 +774,10 @@ class CourseMode(models.Model):
|
||||
If there is no mode found, will return the price of DEFAULT_MODE, which is 0
|
||||
"""
|
||||
modes = cls.modes_for_course(course_id)
|
||||
return min(mode.min_price for mode in modes if mode.currency.lower() == currency.lower())
|
||||
return min(
|
||||
(mode.min_price for mode in modes if mode.currency.lower() == currency.lower()),
|
||||
default=0
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def is_eligible_for_certificate(cls, mode_slug, status=None):
|
||||
|
||||
Reference in New Issue
Block a user