Upgrade to Flask 1.0
parent
55caf167c9
commit
d5d2c4d8c8
|
@ -13,6 +13,7 @@ api.add_resource(TokenResource, '/v1/token')
|
||||||
|
|
||||||
|
|
||||||
@api_bp.errorhandler(ValidationError)
|
@api_bp.errorhandler(ValidationError)
|
||||||
|
@api_bp.errorhandler(422)
|
||||||
def handle_validation_error(e):
|
def handle_validation_error(e):
|
||||||
return {'status': 'error', 'message': str(e)}, 422
|
return {'status': 'error', 'message': str(e)}, 422
|
||||||
|
|
||||||
|
|
|
@ -7,8 +7,8 @@ import app.accounts as accounts
|
||||||
class TokenResource(Resource):
|
class TokenResource(Resource):
|
||||||
user_args = {
|
user_args = {
|
||||||
'user': fields.Nested({
|
'user': fields.Nested({
|
||||||
'username': fields.Str(),
|
'username': fields.Str(required=True),
|
||||||
'password': fields.Str()
|
'password': fields.Str(required=True)
|
||||||
}, required=True, location='json')
|
}, required=True, location='json')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ aniso8601==3.0.0
|
||||||
bcrypt==3.1.4
|
bcrypt==3.1.4
|
||||||
cffi==1.11.5
|
cffi==1.11.5
|
||||||
click==6.7
|
click==6.7
|
||||||
Flask==0.12.2
|
Flask==1.0.2
|
||||||
Flask-API==1.0
|
Flask-API==1.0
|
||||||
Flask-Bcrypt==0.7.1
|
Flask-Bcrypt==0.7.1
|
||||||
Flask-Migrate==2.1.1
|
Flask-Migrate==2.1.1
|
||||||
|
@ -21,12 +21,12 @@ paho-mqtt==1.3.1
|
||||||
psycopg2==2.7.4
|
psycopg2==2.7.4
|
||||||
psycopg2-binary==2.7.4
|
psycopg2-binary==2.7.4
|
||||||
pycparser==2.18
|
pycparser==2.18
|
||||||
PyJWT==1.4.2
|
PyJWT==1.6.1
|
||||||
python-dateutil==2.7.2
|
python-dateutil==2.7.2
|
||||||
python-editor==1.0.3
|
python-editor==1.0.3
|
||||||
pytz==2018.4
|
pytz==2018.4
|
||||||
six==1.11.0
|
six==1.11.0
|
||||||
SQLAlchemy==1.2.7
|
SQLAlchemy==1.2.7
|
||||||
typing==3.6.4
|
typing==3.6.4
|
||||||
webargs==2.1.0
|
webargs==3.0.0
|
||||||
Werkzeug==0.14.1
|
Werkzeug==0.14.1
|
||||||
|
|
Loading…
Reference in New Issue