Skip to content

Commit d16174c

Browse files
authored
Merge pull request #260 from eduNEXT/jlc/backport-500-currency-about-page
Fix to prevent 500 error when course mode currency in NELP
2 parents 223efd9 + b84b84d commit d16174c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

common/djangoapps/course_modes/models.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,10 @@ def min_course_price_for_currency(cls, course_id, currency):
766766
If there is no mode found, will return the price of DEFAULT_MODE, which is 0
767767
"""
768768
modes = cls.modes_for_course(course_id)
769-
return min(mode.min_price for mode in modes if mode.currency.lower() == currency.lower())
769+
return min(
770+
(mode.min_price for mode in modes if mode.currency.lower() == currency.lower()),
771+
default=0
772+
)
770773

771774
@classmethod
772775
def is_eligible_for_certificate(cls, mode_slug, status=None):

0 commit comments

Comments
 (0)