From 8f3c9c33cba41439082a1581c1ce09d171883a4c Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Tue, 2 Mar 2021 17:11:34 +0100 Subject: [PATCH] adding the correct vars to env --- ereuse_devicehub/config.py | 1 + ereuse_devicehub/resources/documents/documents.py | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ereuse_devicehub/config.py b/ereuse_devicehub/config.py index beef8b25..5a37ace0 100644 --- a/ereuse_devicehub/config.py +++ b/ereuse_devicehub/config.py @@ -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, diff --git a/ereuse_devicehub/resources/documents/documents.py b/ereuse_devicehub/resources/documents/documents.py index 8aa345e4..947ac85e 100644 --- a/ereuse_devicehub/resources/documents/documents.py +++ b/ereuse_devicehub/resources/documents/documents.py @@ -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