Skip to content

Commit

Permalink
Make language validation more closely match previous errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathangreen committed Jul 20, 2023
1 parent a5d2257 commit 7c5644b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/configuration/library.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion tests/api/admin/controller/test_library.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

Expand Down

0 comments on commit 7c5644b

Please sign in to comment.