MICROBA-1055 Require a valid enrollment mode, even on the allowlist (#27012)

This commit is contained in:
Christie Rice
2021-03-16 09:37:27 -04:00
committed by GitHub
parent 6f7e6bca87
commit 90f5e42dbd
6 changed files with 47 additions and 7 deletions

View File

@@ -15,3 +15,15 @@ def get_paid_modes_for_course(course_run_id):
A list of paid modes (strings) that the course has attached to it.
"""
return _CourseMode.paid_modes_for_course(course_run_id)
def is_eligible_for_certificate(mode_slug, status=None):
"""
Returns whether or not the given mode_slug is eligible for a
certificate. Currently all modes other than 'audit' grant a
certificate. Note that audit enrollments which existed prior
to December 2015 *were* given certificates, so there will be
GeneratedCertificate records with mode='audit' which are
eligible.
"""
return _CourseMode.is_eligible_for_certificate(mode_slug, status)