Rename *_resource_fields to *_model.
This commit is contained in:
parent
3fd746916c
commit
5864d4700d
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user