#23596: request.session.save() raise TypeError: [<Group: Admin user>] is not 
JSON
serializable
-------------------------+-------------------------------------------------
     Reporter:  caot     |      Owner:  nobody
         Type:  Bug      |     Status:  new
    Component:           |    Version:  1.7
  contrib.sessions       |   Keywords:  session save serializer dumps JSON
     Severity:  Normal   |  serializable
 Triage Stage:           |  Has patch:  0
  Unreviewed             |      UI/UX:  1
Easy pickings:  0        |
-------------------------+-------------------------------------------------
 request.session.save() raise TypeError: [<Group: Admin user>] is not JSON
 serializable

 it's the auth.models.Group.objects.all() that is not JSON serializable. it
 worked perfect well upto django 1.5.

 Django 1.5:

 {{{
     def encode(self, session_dict):
         "Returns the given session dictionary pickled and encoded as a
 string."
         pickled = pickle.dumps(session_dict, pickle.HIGHEST_PROTOCOL)
         hash = self._hash(pickled)
         return base64.b64encode(hash.encode() + b":" +
 pickled).decode('ascii')
 }}}

 Django 1.7:


 {{{
     def encode(self, session_dict):
         "Returns the given session dictionary serialized and encoded as a
 string."
         serialized = self.serializer().dumps(session_dict)
         hash = self._hash(serialized)
         return base64.b64encode(hash.encode() + b":" +
 serialized).decode('ascii')
 }}}


 it looks there is some issue with self.serializer().

--
Ticket URL: <https://code.djangoproject.com/ticket/23596>
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/047.dc6af2a5b21c400ea573d39155040cf1%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to