diff --git a/accountant/api/views/users.py b/accountant/api/views/users.py index 1392c3a..afaffa7 100644 --- a/accountant/api/views/users.py +++ b/accountant/api/views/users.py @@ -61,13 +61,13 @@ def requires_auth(f): return wrapped -token_resource_fields = { +token_model = { 'token': fields.String, 'expiration': fields.DateTime(dt_format='iso8601'), 'token_type': fields.String } -user_resource_fields = { +user_model = { 'id': fields.Integer(default=None), 'email': fields.String, 'active': fields.Boolean @@ -79,7 +79,7 @@ parser.add_argument('password', type=str, required=True) class LoginResource(Resource): - @marshal_with(token_resource_fields) + @marshal_with(token_model) def post(self): """ Login to retrieve authentication token. @@ -105,7 +105,7 @@ class LoginResource(Resource): }, 200 @requires_auth - @marshal_with_field(Object(user_resource_fields)) + @marshal_with_field(Object(user_model)) def get(self): return g.user, 200