#24836: force_text doesn't force SimpleLazyObject into a string
-------------------------------+--------------------
Reporter: riklaunim | Owner: nobody
Type: Uncategorized | Status: new
Component: Utilities | Version: 1.8
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------
With Django 1.8
https://github.com/django/django/commit/8099d33b6553c9ee7de779ae9d191a1bf22adbda
csrf_token now is a SimpleLazyObject. In my view for Facebook
authentication JavaScript made an ajax request to authenticate user and
get data back. To get new csrf_token I used:
{{{
force_text(csrf(request).get('csrf_token'))
}}}
But now json can't encode SimpleLazyObject. Should force_text force it to
string or maybe using vanilla json isn't recommended even more for
anything-Django data?
--
Ticket URL: <https://code.djangoproject.com/ticket/24836>
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/052.5d731a425bc5f0c51765e594e4a34fec%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.