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