Ugh. Fix the new MessagePack serialiser to interface reliably with the msgpack library (gotta pass some flags and stuff) - also, actually depend on msgpack to make sure we have it

This commit is contained in:
Danielle McLean 2018-05-28 21:33:20 +10:00
parent 8d4444cfb9
commit 142e3eff2b
Signed by untrusted user: 00dani
GPG key ID: 8EB789DDF3ABD240
3 changed files with 21 additions and 5 deletions

View file

@ -5,7 +5,7 @@ from django_redis.serializers.base import BaseSerializer
class MSGPackModernSerializer(BaseSerializer):
def dumps(self, value):
return msgpack.dumps(value)
return msgpack.packb(value, use_bin_type=True)
def loads(self, value):
return msgpack.loads(value)
return msgpack.unpackb(value, raw=False)