Fix balances returning.

This commit is contained in:
Alexis Lahouze 2017-05-25 21:46:34 +02:00
parent 61e9f036c1
commit a664c661ed

View File

@ -7,7 +7,7 @@ import dateutil.parser
from flask_jwt_extended import jwt_required from flask_jwt_extended import jwt_required
from flask_restplus import Namespace, Resource, fields 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.accounts import Account
from ..models.operations import Operation 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 # Note: if we don't pass the code, the result is seen as a tuple and
# causes error on marshalling. # causes error on marshalling.
return account.balances(), 200 return row_as_dict(
account.balances()
), 200
@ns.route('/<int:account_id>/balance') @ns.route('/<int:account_id>/balance')