fix: "Course org display str" option doesnt influence certificate (#34465)

"Course organization display string" option in Advanced settings doesn't influence certificate
Co-authored-by: Dima Alipov <dimaalipov@MacBook-Pro-Dima.local>
This commit is contained in:
Dmytro
2024-04-23 15:21:32 +02:00
committed by GitHub
parent 7ef3674833
commit 9738f61519

View File

@@ -407,14 +407,15 @@ def _update_organization_context(context, course):
Updates context with organization related info.
"""
partner_long_name, organization_logo = None, None
partner_short_name = course.display_organization if course.display_organization else course.org
course_org_display = course.display_organization
organizations = organizations_api.get_course_organizations(course_key=course.id)
if organizations:
# TODO Need to add support for multiple organizations, Currently we are interested in the first one.
organization = organizations[0]
partner_long_name = organization.get('name', partner_long_name)
partner_short_name = organization.get('short_name', partner_short_name)
course_org_display = course_org_display or organization.get('short_name')
organization_logo = organization.get('logo', None)
partner_short_name = course_org_display or course.org
context['organization_long_name'] = partner_long_name
context['organization_short_name'] = partner_short_name