From 170c7727e484f1b0c12cf9eddf77c544b80828c9 Mon Sep 17 00:00:00 2001 From: William Colmenares Date: Wed, 5 Jun 2019 06:02:14 -0400 Subject: [PATCH] clean up catch error --- flaskapp/app.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flaskapp/app.py b/flaskapp/app.py index 19846b0..9e01226 100644 --- a/flaskapp/app.py +++ b/flaskapp/app.py @@ -43,7 +43,7 @@ class ProtectedView(Resource): assert(realm == config('REALM_ALLOWED')) code = check_otp(user, realm, token) assert(code == 200) - except KeyError or AssertionError: + except (KeyError, AssertionError) as e: response = app.response_class(response=json.dumps({'Message': 'Invalid data'}), status=400, mimetype='application/json') @@ -63,4 +63,4 @@ api.add_resource(MainView, '/') api.add_resource(ProtectedView, '/protected') if __name__ == '__main__': - app.run() + app.run(host='::')