diff options
| author | Arthur Vuillard <arthur@hashbang.fr> | 2026-05-22 16:09:20 +0200 |
|---|---|---|
| committer | Jacob Walls <jacobtylerwalls@gmail.com> | 2026-05-26 11:52:07 -0400 |
| commit | 95514247d86ebe0a1582d1fa7a9ffc314ac514f4 (patch) | |
| tree | 5241be7f3cbe1d8c2fb6b335f4022476a7b915ec /docs/ref/forms | |
| parent | 032549216074d25628a9d63f44767fa1ed801286 (diff) | |
Fixed #37116 -- Explained why a code is useful in a ValidationError.
Diffstat (limited to 'docs/ref/forms')
| -rw-r--r-- | docs/ref/forms/validation.txt | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/docs/ref/forms/validation.txt b/docs/ref/forms/validation.txt index 5715d15fa7..4ff73cb88a 100644 --- a/docs/ref/forms/validation.txt +++ b/docs/ref/forms/validation.txt @@ -117,7 +117,8 @@ Raising ``ValidationError`` In order to make error messages flexible and easy to override, consider the following guidelines: -* Provide a descriptive error ``code`` to the constructor:: +* Provide a descriptive error ``code`` to the constructor, to allow + programmatic use (e.g. in tests) that will not vary with translations:: # Good ValidationError(_("Invalid value"), code="invalid") |
