diff --git a/app.py b/app.py index e6dad41f..7ab66779 100644 --- a/app.py +++ b/app.py @@ -71,6 +71,7 @@ app = Flask(__name__) # AppConfig(app) app.config.from_object(app_config) # for db init with required keys +app.app_config = app_config # app.config["config"] = app_config() # logging diff --git a/config.py b/config.py index ba6b917f..dbb9213d 100644 --- a/config.py +++ b/config.py @@ -20,6 +20,8 @@ load_dotenv(find_dotenv()) # CLASSES class Config: + is_development = False + is_production = False # Miscellaneous DEBUG = False # av.input_bool(os.getenv('DEBUG'), 'DEBUG', 'Config') TESTING = False @@ -68,11 +70,13 @@ class Config: RECAPTCHA_PRIVATE_KEY = os.getenv('RECAPTCHA_PRIVATE_KEY') class DevelopmentConfig(Config): + is_development = True DEBUG = True MAIL_DEBUG = True # Add development-specific configuration variables class ProductionConfig(Config): + is_production = True # Add production-specific configuration variables pass diff --git a/helpers/__pycache__/helper_app.cpython-312.pyc b/helpers/__pycache__/helper_app.cpython-312.pyc index 9213c9d4..1900ccb8 100644 Binary files a/helpers/__pycache__/helper_app.cpython-312.pyc and b/helpers/__pycache__/helper_app.cpython-312.pyc differ diff --git a/helpers/helper_app.py b/helpers/helper_app.py index ad0fd36e..ca78e365 100644 --- a/helpers/helper_app.py +++ b/helpers/helper_app.py @@ -36,5 +36,7 @@ class Helper_App(BaseModel): @staticmethod def console_log(message): - if current_app.config["DEBUG"]: - print(message) \ No newline at end of file + if current_app.app_config.is_development: + print(message) + elif current_app.app_config.is_production: + current_app.logger.info(message) \ No newline at end of file diff --git a/static/MySQL/7313_p_get_many_user.sql b/static/MySQL/7313_p_get_many_user.sql index 4bac0863..165f31d3 100644 --- a/static/MySQL/7313_p_get_many_user.sql +++ b/static/MySQL/7313_p_get_many_user.sql @@ -92,13 +92,11 @@ BEGIN IF ISNULL(a_id_user) THEN INSERT INTO tmp_Msg_Error ( - guid, id_type, code, msg ) VALUES ( - v_guid, v_id_type_error_bad_data, v_code_error_bad_data, CONCAT('User ID required for authorisation.') @@ -479,9 +477,9 @@ END // DELIMITER ;; -/* -CALL p_get_many_user ( +CALL p_get_many_user (NULL, 'google-oauth2|109567376920138999933', False, False, False, NULL, 'google-oauth2|109567376920138999933', 0); +/* NULL # a_id_user , 'auth0|6582b95c895d09a70ba10fef' # a_id_user_auth0 , 0 # a_get_all_user @@ -489,9 +487,10 @@ CALL p_get_many_user ( , 0 # a_get_first_user_only , NULL # a_ids_user , 'auth0|6582b95c895d09a70ba10fef' # a_ids_user_auth0 - , 1 -- a_debug -); + , 0 -- a_debug +);*/ +/* select * FROM partsltd_prod.Shop_Calc_User_Temp; delete FROM partsltd_prod.Shop_Calc_User_Temp;