From a664c661ed4c0aef0a3a7436f7d2b0690e41781b Mon Sep 17 00:00:00 2001 From: Alexis Lahouze Date: Thu, 25 May 2017 21:46:34 +0200 Subject: [PATCH] Fix balances returning. --- accountant/views/accounts.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/accountant/views/accounts.py b/accountant/views/accounts.py index 83e5ba8..3927a7a 100644 --- a/accountant/views/accounts.py +++ b/accountant/views/accounts.py @@ -7,7 +7,7 @@ import dateutil.parser from flask_jwt_extended import jwt_required from flask_restplus import Namespace, Resource, fields -from ..models import db +from ..models import db, row_as_dict from ..models.accounts import Account from ..models.operations import Operation @@ -268,7 +268,9 @@ class BalancesResource(Resource): # Note: if we don't pass the code, the result is seen as a tuple and # causes error on marshalling. - return account.balances(), 200 + return row_as_dict( + account.balances() + ), 200 @ns.route('//balance')