Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove edX support URL from login page #28577

Merged
merged 1 commit into from
Sep 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions lms/static/js/student_account/views/LoginView.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,14 +225,13 @@
{
email: error.responseJSON.email,
platform_name: this.platform_name,
support_url: 'https://support.edx.org/',
line_break: HtmlUtils.HTML('<br/>'),
strong_start: HtmlUtils.HTML('<strong>'),
strong_end: HtmlUtils.HTML('</strong>'),
anchorStart: HtmlUtils.HTML(
StringUtils.interpolate(
'<a href="{SupportUrl}">', {
SupportUrl: 'https://support.edx.org/'
SupportUrl: this.supportURL,
}
)
),
Expand Down
25 changes: 14 additions & 11 deletions openedx/core/djangoapps/site_configuration/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,18 +134,21 @@ def get_value(val_name, default=None, **kwargs): # lint-amnesty, pylint: disabl
else:
configuration_value = default

# Attempt to perform a dictionary update using the provided default
# This will fail if the default value is not a dictionary
try:
value = dict(default)
value.update(configuration_value)

# If the dictionary update fails, just use the configuration value
# TypeError: default is not iterable (simple value or None)
# ValueError: default is iterable but not a dict (list, not dict)
# AttributeError: default does not have an 'update' method
except (TypeError, ValueError, AttributeError):
if default == '':
value = configuration_value
else:
# Attempt to perform a dictionary update using the provided default
# This will fail if the default value is not a dictionary
try:
value = dict(default)
value.update(configuration_value)

# If the dictionary update fails, just use the configuration value
# TypeError: default is not iterable (simple value or None)
# ValueError: default is iterable but not a dict (list, not dict)
# AttributeError: default does not have an 'update' method
except (TypeError, ValueError, AttributeError):
value = configuration_value

# Return the end result to the caller
return value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ def test_get_value(self):
# Test that the default value is returned if the value for the given key is not found in the configuration
assert configuration_helpers.get_value('non_existent_name', 'dummy-default-value') == 'dummy-default-value'

# Test that correct default value is returned
assert configuration_helpers.get_value('non_existent_name', '') == ''
assert configuration_helpers.get_value('non_existent_name', None) is None

@with_site_configuration(configuration=test_config)
def test_get_dict(self):
"""
Expand Down