From c1162864aa25769d95fdd01f02242011b7d11742 Mon Sep 17 00:00:00 2001 From: asadiqbal Date: Mon, 31 Aug 2015 21:17:40 +0500 Subject: [PATCH] SOL-1158 --- .../certificates/tests/test_views.py | 5 +-- lms/djangoapps/certificates/views/webview.py | 35 ++++++++++++------- requirements/edx/github.txt | 2 +- 3 files changed, 27 insertions(+), 15 deletions(-) diff --git a/lms/djangoapps/certificates/tests/test_views.py b/lms/djangoapps/certificates/tests/test_views.py index 21c8930d43..2fd8f3ece9 100644 --- a/lms/djangoapps/certificates/tests/test_views.py +++ b/lms/djangoapps/certificates/tests/test_views.py @@ -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( diff --git a/lms/djangoapps/certificates/views/webview.py b/lms/djangoapps/certificates/views/webview.py index 2396fe4ee6..e9cd519432 100644 --- a/lms/djangoapps/certificates/views/webview.py +++ b/lms/djangoapps/certificates/views/webview.py @@ -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 ) diff --git a/requirements/edx/github.txt b/requirements/edx/github.txt index 50c6249adf..4a1490a457 100644 --- a/requirements/edx/github.txt +++ b/requirements/edx/github.txt @@ -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