#30723: Lazy translations in field help cause JSON serialize errors
-------------------------------------+-------------------------------------
Reporter: Rob | Owner: nobody
Lineberger |
Type: | Status: new
Uncategorized |
Component: | Version: 2.2
contrib.auth | Keywords: json lazy
Severity: Normal | serialization
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
Attempting to json.dumps() the result of apps.get_models() leads to a
TypeError:
{{{
TypeError at /uploader/select-models/
'Designates whether this user should be treated as active. Unselect this
instead of deleting accounts.' is not JSON serializable
}}}
That is because "Designates whether this user should be treated as active.
...." is not a string, but the converted representation of a
django.utils.functional.lazy.<locals>__proxy__ object. That is not JSON
serializable.
Debugging this is onerous because in all respects the help text looks and
acts like a string.
--
Ticket URL: <https://code.djangoproject.com/ticket/30723>
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 on the web visit
https://groups.google.com/d/msgid/django-updates/050.5e6c3dda4b4712bec1e495887fe530a2%40djangoproject.com.