SOL-1158
This commit is contained in:
@@ -479,7 +479,8 @@ class CertificatesViewsTests(ModuleStoreTestCase, EventTrackingTestCase):
|
||||
Test: organization data should render on certificate web view if course has organization.
|
||||
"""
|
||||
test_organization_data = {
|
||||
'name': 'test_organization',
|
||||
'name': 'test organization',
|
||||
'short_name': 'test_organization',
|
||||
'description': 'Test Organization Description',
|
||||
'active': True,
|
||||
'logo': '/logo_test1.png/'
|
||||
@@ -493,7 +494,7 @@ class CertificatesViewsTests(ModuleStoreTestCase, EventTrackingTestCase):
|
||||
)
|
||||
response = self.client.get(test_url)
|
||||
self.assertIn(
|
||||
'a course of study offered by test_organization',
|
||||
'a course of study offered by test_organization, an online learning initiative of test organization',
|
||||
response.content
|
||||
)
|
||||
self.assertNotIn(
|
||||
|
||||
@@ -87,12 +87,14 @@ def _update_certificate_context(context, course, user, user_certificate):
|
||||
user_fullname = user.profile.name
|
||||
platform_name = microsite.get_value("platform_name", settings.PLATFORM_NAME)
|
||||
certificate_type = context.get('certificate_type')
|
||||
partner_name = course.org
|
||||
partner_short_name = course.org
|
||||
partner_long_name = None
|
||||
organizations = organization_api.get_course_organizations(course_id=course.id)
|
||||
if organizations:
|
||||
#TODO Need to add support for multiple organizations, Currently we are interested in the first one.
|
||||
organization = organizations[0]
|
||||
partner_name = organization.get('name', course.org)
|
||||
partner_long_name = organization.get('name', None)
|
||||
partner_short_name = organization.get('short_name', course.org)
|
||||
context['organization_logo'] = organization.get('logo', None)
|
||||
|
||||
context['username'] = user.username
|
||||
@@ -100,7 +102,7 @@ def _update_certificate_context(context, course, user, user_certificate):
|
||||
context['accomplishment_user_id'] = user.id
|
||||
context['accomplishment_copy_name'] = user_fullname
|
||||
context['accomplishment_copy_username'] = user.username
|
||||
context['accomplishment_copy_course_org'] = partner_name
|
||||
context['accomplishment_copy_course_org'] = partner_short_name
|
||||
context['accomplishment_copy_course_name'] = course.display_name
|
||||
context['course_image_url'] = course_image_url(course)
|
||||
context['share_settings'] = settings.FEATURES.get('SOCIAL_SHARING_SETTINGS', {})
|
||||
@@ -126,11 +128,20 @@ def _update_certificate_context(context, course, user, user_certificate):
|
||||
year=user_certificate.modified_date.year
|
||||
)
|
||||
|
||||
context['accomplishment_copy_course_description'] = _('a course of study offered by {partner_name}, '
|
||||
'through {platform_name}.').format(
|
||||
partner_name=partner_name,
|
||||
platform_name=platform_name
|
||||
)
|
||||
if partner_long_name:
|
||||
context['accomplishment_copy_course_description'] = _('a course of study offered by {partner_short_name}, an '
|
||||
'online learning initiative of {partner_long_name} '
|
||||
'through {platform_name}.').format(
|
||||
partner_short_name=partner_short_name,
|
||||
partner_long_name=partner_long_name,
|
||||
platform_name=platform_name
|
||||
)
|
||||
else:
|
||||
context['accomplishment_copy_course_description'] = _('a course of study offered by {partner_short_name}, '
|
||||
'through {platform_name}.').format(
|
||||
partner_short_name=partner_short_name,
|
||||
platform_name=platform_name
|
||||
)
|
||||
|
||||
# Translators: Accomplishments describe the awards/certifications obtained by students on this platform
|
||||
context['accomplishment_copy_about'] = _('About {platform_name} Accomplishments').format(
|
||||
@@ -201,16 +212,16 @@ def _update_certificate_context(context, course, user, user_certificate):
|
||||
|
||||
# Translators: This text represents the verification of the certificate
|
||||
context['document_meta_description'] = _('This is a valid {platform_name} certificate for {user_name}, '
|
||||
'who participated in {partner_name} {course_number}').format(
|
||||
'who participated in {partner_short_name} {course_number}').format(
|
||||
platform_name=platform_name,
|
||||
user_name=user_fullname,
|
||||
partner_name=partner_name,
|
||||
partner_short_name=partner_short_name,
|
||||
course_number=course.number
|
||||
)
|
||||
|
||||
# Translators: This text is bound to the HTML 'title' element of the page and appears in the browser title bar
|
||||
context['document_title'] = _("{partner_name} {course_number} Certificate | {platform_name}").format(
|
||||
partner_name=partner_name,
|
||||
context['document_title'] = _("{partner_short_name} {course_number} Certificate | {platform_name}").format(
|
||||
partner_short_name=partner_short_name,
|
||||
course_number=course.number,
|
||||
platform_name=platform_name
|
||||
)
|
||||
|
||||
@@ -55,7 +55,7 @@ git+https://github.com/edx/edx-lint.git@b109a40c61277c52dcb396bf15e33755f5dbf5fa
|
||||
-e git+https://github.com/edx/edx-reverification-block.git@30fcf2fea305ed6649adcee9c831afaefba635c5#egg=edx-reverification-block
|
||||
git+https://github.com/edx/ecommerce-api-client.git@1.1.0#egg=ecommerce-api-client==1.1.0
|
||||
-e git+https://github.com/edx/edx-user-state-client.git@30c0ad4b9f57f8d48d6943eb585ec8a9205f4469#egg=edx-user-state-client
|
||||
-e git+https://github.com/edx/edx-organizations.git@release-2015-08-25#egg=edx-organizations
|
||||
-e git+https://github.com/edx/edx-organizations.git@release-2015-08-31#egg=edx-organizations
|
||||
|
||||
git+https://github.com/edx/edx-proctoring.git@0.7.2#egg=edx-proctoring==0.7.2
|
||||
|
||||
|
||||
Reference in New Issue
Block a user