Skip to content

Commit

Permalink
Don't drop 0s when transforming to JSON
Browse files Browse the repository at this point in the history
This fixes issue #75
  • Loading branch information
Corentin Chary committed Jan 29, 2016
1 parent 9113016 commit 38c38d0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions marathon/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ def default(self, obj):

if isinstance(obj, collections.Iterable) and not is_stringy(obj):
try:
return {k: self.default(v) for k, v in obj.items() if (v or v is False)}
return {k: self.default(v) for k, v in obj.items() if (v or v is False or v is 0)}
except AttributeError:
return [self.default(e) for e in obj if (e or e is False)]
return [self.default(e) for e in obj if (e or e is False or e is 0)]

return obj

Expand Down

0 comments on commit 38c38d0

Please sign in to comment.