From fce1699a55ddfa5610fc9fea1e3fcb54b47f9a8b Mon Sep 17 00:00:00 2001 From: Matt Tuchfarber Date: Tue, 20 Mar 2018 16:03:47 -0400 Subject: [PATCH] Enables disabling of auth urls for program cert linkings. WL credentials sites are not set up with site aware OAuth and therefore require that --- openedx/core/djangoapps/programs/utils.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/openedx/core/djangoapps/programs/utils.py b/openedx/core/djangoapps/programs/utils.py index e465341606..f87344470a 100644 --- a/openedx/core/djangoapps/programs/utils.py +++ b/openedx/core/djangoapps/programs/utils.py @@ -28,6 +28,7 @@ from openedx.core.djangoapps.catalog.utils import get_programs, get_fulfillable_ from openedx.core.djangoapps.commerce.utils import ecommerce_api_client from openedx.core.djangoapps.content.course_overviews.models import CourseOverview from openedx.core.djangoapps.credentials.utils import get_credentials +from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers from student.models import CourseEnrollment from util.date_utils import strftime_localized from xmodule.modulestore.django import modulestore @@ -670,10 +671,17 @@ def get_certificates(user, extended_program): program_credentials = get_credentials(user, program_uuid=extended_program['uuid']) # only include a program certificate if a certificate is available for every course if program_credentials and (len(certificates) == len(extended_program['courses'])): + enabled_force_program_cert_auth = configuration_helpers.get_value( + 'force_program_cert_auth', + True + ) + cert_url = program_credentials[0]['certificate_url'] + url = get_logged_in_program_certificate_url(cert_url) if enabled_force_program_cert_auth else cert_url + certificates.append({ 'type': 'program', 'title': extended_program['title'], - 'url': get_logged_in_program_certificate_url(program_credentials[0]['certificate_url']), + 'url': url, }) return certificates