diff --git a/hodor/__init__.py b/hodor/__init__.py index a9ec7a8b5e6530b6595ca3e8b3bba62bdffed60f..e20e725b4a857a3291988e1191b2eafd0797d92b 100644 --- a/hodor/__init__.py +++ b/hodor/__init__.py @@ -1,5 +1,8 @@ # -*- coding: utf-8 -*- # app/__init__.py +import os +import sys +import time from termcolor import colored from flask_api import FlaskAPI from flask_sqlalchemy import SQLAlchemy @@ -23,14 +26,14 @@ application.config['SECRET_KEY'] = 'blehblehbleh' # Delay the application launch to get the user attention if running in # testing mode -''' -if config_name != 'production': + +if config_name != 'production' and not os.getenv('SKIP_COUNT'): for x in range(0, 5): sys.stdout.write(colored("\rYou are not running the server in production mode. " + "App will run in {} seconds..".format(5-x), 'red')) sys.stdout.flush() time.sleep(1) -''' + print(colored("\n\nRunning app in {} mode..".format(config_name), 'yellow')) # This disables the HTML API renderer for flask_api when called through diff --git a/hodor/controllers/user.py b/hodor/controllers/user.py index 9437491e09511cbba02d6f9cfd3a66ec71639a19..92bb5d79010df1eed18c23de447744adbddebfe9 100644 --- a/hodor/controllers/user.py +++ b/hodor/controllers/user.py @@ -145,7 +145,7 @@ def handle_sql_assertion_error(err): errmsg = err.orig.args[0].split('\n') except IndexError: errmsg = err.orig.args[0] - + return make_response(jsonify(status=400, msg=errmsg), 400)