Support the display of downloadable PDF course certs ECOM-5790

This commit is contained in:
Simon Chen
2016-12-07 20:47:46 -05:00
parent ff7c2f8c85
commit 6dbfb3261e
2 changed files with 62 additions and 11 deletions

View File

@@ -373,6 +373,8 @@ class ProgramDataExtender(object):
certificate_data = certificate_api.certificate_downloadable_status(self.user, self.course_key)
certificate_uuid = certificate_data.get('uuid')
run_mode['certificate_url'] = certificate_api.get_certificate_url(
user_id=self.user.id, # Providing user_id allows us to fall back to PDF certificates
# if web certificates are not configured for a given course.
course_id=self.course_key,
uuid=certificate_uuid,
) if certificate_uuid else None