adding the correct vars to env

This commit is contained in:
Cayo Puigdefabregas 2021-03-02 17:11:34 +01:00
parent f9ef240749
commit 8f3c9c33cb
2 changed files with 5 additions and 4 deletions

View File

@ -37,6 +37,7 @@ class DevicehubConfig(Config):
DB_PASSWORD = config('DB_PASSWORD', 'ereuse') DB_PASSWORD = config('DB_PASSWORD', 'ereuse')
DB_HOST = config('DB_HOST', 'localhost') DB_HOST = config('DB_HOST', 'localhost')
DB_DATABASE = config('DB_DATABASE', 'devicehub') DB_DATABASE = config('DB_DATABASE', 'devicehub')
DB_SCHEMA = config('DB_SCHEMA', 'dbtest')
SQLALCHEMY_DATABASE_URI = 'postgresql://{user}:{pw}@{host}/{db}'.format( SQLALCHEMY_DATABASE_URI = 'postgresql://{user}:{pw}@{host}/{db}'.format(
user=DB_USER, user=DB_USER,
pw=DB_PASSWORD, pw=DB_PASSWORD,

View File

@ -293,14 +293,14 @@ class InternalStatsView(DeviceView):
return output return output
class WbConfDocumentView(View): class WbConfDocumentView(DeviceView):
def get(self, wbtype: str): def get(self, wbtype: str):
if not wbtype.lower() in ['usodyrate', 'usodywipe']: if not wbtype.lower() in ['usodyrate', 'usodywipe']:
return jsonify('') return jsonify('')
data = {'token': '111', data = {'token': g.user.token,
'host': 'localhost', 'host': app.config['DB_HOST'],
'inventory': 'dbtest' 'inventory': app.config['DB_SCHEMA']
} }
data['erase'] = False if wbtype == 'usodyrate' else True data['erase'] = False if wbtype == 'usodyrate' else True