Commit 75945b8c by Douglas Hall Committed by GitHub

Merge pull request #12791 from edx/ibrahimahmed443/WL-529-platform-name-theme-override

replace references to settings.PLATFORM_NAME in edx-platform with the…
parents b89fc917 603546a0
......@@ -21,6 +21,7 @@ from social.backends.saml import SAMLAuth, SAMLIdentityProvider
from .lti import LTIAuthBackend, LTI_PARAMS_KEY
from social.exceptions import SocialAuthBaseException
from social.utils import module_member
from openedx.core.djangoapps.theming.helpers import get_value as get_themed_value
log = logging.getLogger(__name__)
......@@ -453,7 +454,7 @@ class SAMLConfiguration(ConfigurationModel):
other_config = json.loads(self.other_config_str)
if name in ("TECHNICAL_CONTACT", "SUPPORT_CONTACT"):
contact = {
"givenName": "{} Support".format(settings.PLATFORM_NAME),
"givenName": "{} Support".format(get_themed_value('PLATFORM_NAME', settings.PLATFORM_NAME)),
"emailAddress": settings.TECH_SUPPORT_EMAIL
}
contact.update(other_config.get(name, {}))
......
......@@ -116,7 +116,7 @@ def _get_course_email_context(course):
'course_end_date': course_end_date,
'account_settings_url': 'https://{}{}'.format(settings.SITE_NAME, reverse('account_settings')),
'email_settings_url': 'https://{}{}'.format(settings.SITE_NAME, reverse('dashboard')),
'platform_name': settings.PLATFORM_NAME,
'platform_name': theming_helpers.get_value('PLATFORM_NAME', settings.PLATFORM_NAME),
}
return email_context
......
......@@ -17,6 +17,7 @@ from wiki.models import URLPath, Article
from courseware.courses import get_course_by_id
from course_wiki.utils import course_wiki_slug
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from openedx.core.djangoapps.theming.helpers import get_value as get_themed_value
log = logging.getLogger(__name__)
......@@ -128,7 +129,8 @@ def get_or_create_root():
pass
starting_content = "\n".join((
_("Welcome to the {platform_name} Wiki").format(platform_name=settings.PLATFORM_NAME),
_("Welcome to the {platform_name} Wiki").format(platform_name=get_themed_value('PLATFORM_NAME',
settings.PLATFORM_NAME)),
"===",
_("Visit a course wiki to add an article."),
))
......
......@@ -1090,7 +1090,7 @@ def generate_user_cert(request, course_id):
log.info(u"Anon user trying to generate certificate for %s", course_id)
return HttpResponseBadRequest(
_('You must be signed in to {platform_name} to create a certificate.').format(
platform_name=settings.PLATFORM_NAME
platform_name=theming_helpers.get_value('PLATFORM_NAME', settings.PLATFORM_NAME)
)
)
......@@ -1206,7 +1206,7 @@ FINANCIAL_ASSISTANCE_HEADER = _(
' financial assistance program.'
).format(
percent_sign="%",
platform_name=settings.PLATFORM_NAME
platform_name=theming_helpers.get_value('PLATFORM_NAME', settings.PLATFORM_NAME)
).split('\n')
......@@ -1326,7 +1326,7 @@ def financial_assistance_form(request):
'student_faq_url': marketing_link('FAQ'),
'dashboard_url': reverse('dashboard'),
'account_settings_url': reverse('account_settings'),
'platform_name': settings.PLATFORM_NAME,
'platform_name': theming_helpers.get_value('PLATFORM_NAME', settings.PLATFORM_NAME),
'user_details': {
'email': user.email,
'username': user.username,
......
......@@ -215,7 +215,7 @@ def require_global_staff(func):
else:
return HttpResponseForbidden(
u"Must be {platform_name} staff to perform this action.".format(
platform_name=settings.PLATFORM_NAME
platform_name=theming_helpers.get_value('PLATFORM_NAME', settings.PLATFORM_NAME)
)
)
return wrapped
......
......@@ -33,6 +33,7 @@ from django.core.mail.message import EmailMessage
from xmodule.modulestore.django import modulestore
from eventtracking import tracker
from openedx.core.djangoapps.theming.helpers import get_value as get_themed_value
from courseware.courses import get_course_by_id
from config_models.models import ConfigurationModel
from course_modes.models import CourseMode
......@@ -2185,7 +2186,7 @@ class Donation(OrderItem):
u"We greatly appreciate this generous contribution and your support of the {platform_name} mission. "
u"This receipt was prepared to support charitable contributions for tax purposes. "
u"We confirm that neither goods nor services were provided in exchange for this gift."
).format(platform_name=settings.PLATFORM_NAME)
).format(platform_name=get_themed_value('PLATFORM_NAME', settings.PLATFORM_NAME))
@classmethod
def _line_item_description(cls, course_id=None):
......@@ -2218,7 +2219,8 @@ class Donation(OrderItem):
# The donation is for the organization as a whole, not a specific course
else:
return _(u"Donation for {platform_name}").format(platform_name=settings.PLATFORM_NAME)
return _(u"Donation for {platform_name}").format(platform_name=get_themed_value('PLATFORM_NAME',
settings.PLATFORM_NAME))
@property
def single_item_receipt_context(self):
......@@ -2243,8 +2245,8 @@ class Donation(OrderItem):
data['name'] = unicode(self.course_id)
data['category'] = unicode(self.course_id.org)
else:
data['name'] = settings.PLATFORM_NAME
data['category'] = settings.PLATFORM_NAME
data['name'] = get_themed_value('PLATFORM_NAME', settings.PLATFORM_NAME)
data['category'] = get_themed_value('PLATFORM_NAME', settings.PLATFORM_NAME)
return data
@property
......
......@@ -419,7 +419,7 @@ class PayAndVerifyView(View):
'display_steps': display_steps,
'is_active': json.dumps(request.user.is_active),
'message_key': message,
'platform_name': settings.PLATFORM_NAME,
'platform_name': theming_helpers.get_value('PLATFORM_NAME', settings.PLATFORM_NAME),
'processors': processors,
'requirements': requirements,
'user_full_name': full_name,
......@@ -1184,7 +1184,7 @@ def _compose_message_reverification_email(
context["verification_open"] = verification_open
context["due_date"] = get_default_time_display(reverification_block.due)
context['platform_name'] = settings.PLATFORM_NAME
context['platform_name'] = theming_helpers.get_value('PLATFORM_NAME', settings.PLATFORM_NAME)
context["used_attempts"] = used_attempts
context["allowed_attempts"] = allowed_attempts
context["support_link"] = microsite.get_value('email_from_address', settings.CONTACT_EMAIL)
......@@ -1384,7 +1384,7 @@ class ReverifyView(View):
if status in ["none", "must_reverify", "expired", "pending"]:
context = {
"user_full_name": request.user.profile.name,
"platform_name": settings.PLATFORM_NAME,
"platform_name": theming_helpers.get_value('PLATFORM_NAME', settings.PLATFORM_NAME),
"capture_sound": staticfiles_storage.url("audio/camera_capture.wav"),
}
return render_to_response("verify_student/reverify.html", context)
......@@ -1449,7 +1449,7 @@ class InCourseReverifyView(View):
'course_key': unicode(course_key),
'course_name': course.display_name_with_default_escaped,
'checkpoint_name': checkpoint.checkpoint_name,
'platform_name': settings.PLATFORM_NAME,
'platform_name': theming_helpers.get_value('PLATFORM_NAME', settings.PLATFORM_NAME),
'usage_id': usage_id,
'capture_sound': staticfiles_storage.url("audio/camera_capture.wav"),
}
......
......@@ -17,6 +17,7 @@ from edxmako.shortcuts import render_to_string
from simple_history.models import HistoricalRecords
from config_models.models import ConfigurationModel
from openedx.core.djangoapps.theming.helpers import get_value as get_themed_value
log = logging.getLogger(__name__)
......@@ -161,7 +162,7 @@ def _send_decision_email(instance):
'authentication_docs_url': settings.AUTH_DOCUMENTATION_URL,
'api_docs_url': settings.API_DOCUMENTATION_URL,
'support_email_address': settings.API_ACCESS_FROM_EMAIL,
'platform_name': settings.PLATFORM_NAME
'platform_name': get_themed_value('PLATFORM_NAME', settings.PLATFORM_NAME)
}
message = render_to_string(
......
......@@ -7,6 +7,7 @@ from django.forms.widgets import CheckboxInput
from django.utils.encoding import force_text
from django.utils.html import format_html
from django.utils.translation import ugettext as _
from openedx.core.djangoapps.theming.helpers import get_value as get_themed_value
class TermsOfServiceCheckboxInput(CheckboxInput):
......@@ -23,7 +24,7 @@ class TermsOfServiceCheckboxInput(CheckboxInput):
# Translators: link_start and link_end are HTML tags for a link to the terms of service.
# platform_name is the name of this Open edX installation.
label = _('I, and my company, accept the {link_start}{platform_name} API Terms of Service{link_end}.').format(
platform_name=settings.PLATFORM_NAME,
platform_name=get_themed_value('PLATFORM_NAME', settings.PLATFORM_NAME),
link_start='<a href="{url}" target="_blank">'.format(url=reverse('api_admin:api-tos')),
link_end='</a>',
)
......
......@@ -73,7 +73,7 @@ def send_credit_notifications(username, course_key):
providers_string = make_providers_strings(providers_names)
context = {
'full_name': user.get_full_name(),
'platform_name': settings.PLATFORM_NAME,
'platform_name': theming_helpers.get_value('PLATFORM_NAME', settings.PLATFORM_NAME),
'course_name': course_display_name,
'branded_logo': logo_image_id,
'dashboard_link': dashboard_link,
......
......@@ -586,7 +586,7 @@ class RegistrationView(APIView):
# Translators: This phrase appears above a field on the registration form
# meant to hold the user's reasons for registering with edX.
goals_label = _(u"Tell us why you're interested in {platform_name}").format(
platform_name=settings.PLATFORM_NAME
platform_name=get_themed_value("PLATFORM_NAME", settings.PLATFORM_NAME)
)
form_desc.add_field(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment