mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
JSON serialization of long type
Numbers of long type were incorrectly serialized to JSON as empty strings when using json_serialize function. It caused problem in serialization of metadata for Web UI. This patch is fixing it. Discovered after "Cast DNS SOA serial maximum boundary to long"
This commit is contained in:
committed by
Martin Kosek
parent
f6fed3c547
commit
1aea8bd18e
@@ -43,7 +43,7 @@ def json_serialize(obj):
|
||||
return [json_serialize(o) for o in obj]
|
||||
if isinstance(obj, dict):
|
||||
return dict((k, json_serialize(v)) for (k, v) in obj.iteritems())
|
||||
if isinstance(obj, (bool, float, int, unicode, NoneType)):
|
||||
if isinstance(obj, (bool, float, int, long, unicode, NoneType)):
|
||||
return obj
|
||||
if isinstance(obj, str):
|
||||
return obj.decode('utf-8')
|
||||
|
||||
Reference in New Issue
Block a user