From 5864d4700d633dbd680598358452cf6ad30c2988 Mon Sep 17 00:00:00 2001 From: Alexis Lahouze Date: Wed, 13 Jan 2016 13:49:28 +0100 Subject: [PATCH] Rename *_resource_fields to *_model. --- accountant/api/views/users.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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