From 79877d09a1ee0dc3b1bbf23c9445e2928dbb0775 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Mon, 7 Nov 2022 17:08:03 +0100 Subject: [PATCH] put api_host in config --- ereuse_devicehub/config.py | 1 + ereuse_devicehub/workbench/views.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ereuse_devicehub/config.py b/ereuse_devicehub/config.py index 86500e26..79a9b75b 100644 --- a/ereuse_devicehub/config.py +++ b/ereuse_devicehub/config.py @@ -59,6 +59,7 @@ class DevicehubConfig(Config): ) # type: str SCHEMA = config('SCHEMA', 'dbtest') HOST = config('HOST', 'localhost') + API_HOST = config('API_HOST', 'localhost') MIN_WORKBENCH = StrictVersion('11.0a1') # type: StrictVersion """The minimum version of ereuse.org workbench that this devicehub accepts. we recommend not changing this value. diff --git a/ereuse_devicehub/workbench/views.py b/ereuse_devicehub/workbench/views.py index 55ae905e..84dbba63 100644 --- a/ereuse_devicehub/workbench/views.py +++ b/ereuse_devicehub/workbench/views.py @@ -55,7 +55,7 @@ class SettingsView(GenericMixin): return flask.render_template(self.template_name, **self.context) def download(self): - url = "https://{}/api/inventory/".format(app.config['HOST']) + url = "https://{}/api/inventory/".format(app.config['API_HOST']) self.wbContext = { 'token': self.get_token(), 'url': url, @@ -65,7 +65,7 @@ class SettingsView(GenericMixin): # if is a v14 version # TODO when not use more v14, we can remove this if if 'erease' in self.opt: - url = "https://{}/actions/".format(app.config['HOST']) + url = "https://{}/actions/".format(app.config['API_HOST']) self.wbContext['url'] = url self.wbContext['host'] = app.config['HOST'] self.wbContext['schema'] = app.config['SCHEMA']