Re: [Django] #30723: Lazy translations in field help cause JSON serialize errors

2019-08-21 Thread Django
#30723: Lazy translations in field help cause JSON serialize errors
-+-
 Reporter:  Rob Lineberger   |Owner:  nobody
 Type:  Uncategorized|   Status:  closed
Component:  contrib.auth |  Version:  2.2
 Severity:  Normal   |   Resolution:
 |  worksforme
 Keywords:  json lazy| Triage Stage:
  serialization  |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Claude Paroz):

 * status:  new => closed
 * resolution:   => worksforme


Comment:

 Django has a special JSON encoder to dumps typical Django data:
 https://docs.djangoproject.com/en/2.2/topics/serialization/#djangojsonencoder
 I don't see what we could do to prevent your bad debugging session, but if
 you have ideas, feel free to suggest them.

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.ab1221b949ebc11e1bd645b1b22c3441%40djangoproject.com.


[Django] #30723: Lazy translations in field help cause JSON serialize errors

2019-08-21 Thread Django
#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.__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: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/050.5e6c3dda4b4712bec1e495887fe530a2%40djangoproject.com.