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_HOST = config('DB_HOST', 'localhost')
DB_DATABASE = config('DB_DATABASE', 'devicehub')
DB_SCHEMA = config('DB_SCHEMA', 'dbtest')
SQLALCHEMY_DATABASE_URI = 'postgresql://{user}:{pw}@{host}/{db}'.format(
user=DB_USER,
pw=DB_PASSWORD,

View file

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