fix: remove edX support URL from login page (#28577)

This commit is contained in:
Zainab Amir
2021-09-01 11:29:39 +05:00
committed by GitHub
parent c1dabd1af3
commit cfc8ab6298
3 changed files with 19 additions and 13 deletions

View File

@@ -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,
}
)
),

View File

@@ -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

View File

@@ -67,6 +67,10 @@ class TestHelpers(TestCase):
# 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):
"""