#37116: The doc mentions that a code in a validationerror is good but does not
tell
why
--------------------------------------+------------------------------------
Reporter: Arthur Vuillard | Owner: (none)
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Jacob Walls):
* needs_better_patch: 0 => 1
* stage: Unreviewed => Accepted
* type: Uncategorized => Cleanup/optimization
* version: 6.0 => dev
Comment:
Sure, that sounds good. My advice would be to weave it into the original
text, like
{{{#!diff
diff --git a/docs/ref/forms/validation.txt b/docs/ref/forms/validation.txt
index 5715d15fa7..31f74350f9 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 allow programmatic use that
will not
+ vary with translations::
# Good
ValidationError(_("Invalid value"), code="invalid")
}}}
I'll reopen your pull request.
--
Ticket URL: <https://code.djangoproject.com/ticket/37116#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/django-updates/0107019e5131e06c-a36c7681-0fdc-40f9-a455-a1cb745a203d-000000%40eu-central-1.amazonses.com.