From 7cb339c0bb8aacaeae47838a68c7af60cf414618 Mon Sep 17 00:00:00 2001 From: Byron Ullauri Date: Wed, 26 Dec 2018 13:07:09 -0500 Subject: Resolve "Update API project list" (#409) * refactoring models _to_serialize property * updated project api members list * addressing flake8: line too long --- ihatemoney/utils.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'ihatemoney/utils.py') diff --git a/ihatemoney/utils.py b/ihatemoney/utils.py index 19340df..ec22834 100644 --- a/ihatemoney/utils.py +++ b/ihatemoney/utils.py @@ -192,11 +192,7 @@ class IhmJSONEncoder(JSONEncoder): Taken from the deprecated flask-rest package.""" def default(self, o): if hasattr(o, "_to_serialize"): - # build up the object - data = {} - for attr in o._to_serialize: - data[attr] = getattr(o, attr) - return data + return o._to_serialize elif hasattr(o, "isoformat"): return o.isoformat() else: -- cgit v1.1