diff --git a/core/configuration/library.py b/core/configuration/library.py index 8d60b839b9..f5330e27de 100644 --- a/core/configuration/library.py +++ b/core/configuration/library.py @@ -643,7 +643,7 @@ def validate_language_codes( field_label = cls.get_form_field_label(field.name) raise SettingsValidationError( problem_detail=UNKNOWN_LANGUAGE.detailed( - f"{field_label}: {language} is not a valid language code." + f'"{field_label}": "{language}" is not a valid language code.' ) ) return value diff --git a/tests/api/admin/controller/test_library.py b/tests/api/admin/controller/test_library.py index e8834dd784..95f8ce824e 100644 --- a/tests/api/admin/controller/test_library.py +++ b/tests/api/admin/controller/test_library.py @@ -340,7 +340,7 @@ def test_libraries_post_errors(self, settings_ctrl_fixture): settings_ctrl_fixture.manager.admin_library_settings_controller.process_post() assert excinfo.value.problem_detail.uri == UNKNOWN_LANGUAGE.uri assert ( - "zzz is not a valid language code" + '"zzz" is not a valid language code' in excinfo.value.problem_detail.detail )