Browse Source

Add empty config field check

pull/1/head
rozetko 6 years ago
parent
commit
126eec22a5
  1. 2
      analytics/config.py
  2. 2
      server/src/config.ts

2
analytics/config.py

@ -16,7 +16,7 @@ def get_config_field(field, default_val = None):
if field in os.environ: if field in os.environ:
return os.environ[field] return os.environ[field]
if config_exists and field in config: if config_exists and field in config and config[field] != '':
return config[field] return config[field]
if default_val is not None: if default_val is not None:

2
server/src/config.ts

@ -37,7 +37,7 @@ function getConfigField(field: string, defaultVal?: any) {
} }
} }
if(val === undefined) { if(val === undefined || val == '') {
throw new Error(`Please configure ${field}`); throw new Error(`Please configure ${field}`);
} }
return val; return val;

Loading…
Cancel
Save