#28618: Add an easier to make templates substitutions raise an exception on
error
-------------------------------------+-------------------------------------
Reporter: Facundo Batista | Owner: shreyas
Type: New feature | Status: assigned
Component: Template system | Version: 1.11
Severity: Normal | Resolution:
Keywords: template error | Triage Stage: Accepted
substitution |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):
* stage: Unreviewed => Accepted
Comment:
As noted on the mailing list, this is already possible by setting
`TEMPLATES ['OPTIONS']['string_if_invalid']` to a class with a `__str__()`
that raises an exception. A proposal from the mailing list thread is to
add a new `'if_invalid'` option that's a callable which would allow more
advanced behavior (raise an exception, logging, etc.). Tentatively
accepting that approach. See #24199 for some related information about the
problem.
--
Ticket URL: <https://code.djangoproject.com/ticket/28618#comment:6>
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 post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/072.0064e5056982a6fcfc4439be6211e4cf%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.