diff --git a/ereuse_devicehub/config.py b/ereuse_devicehub/config.py index 3534ba98..cc4a65f5 100644 --- a/ereuse_devicehub/config.py +++ b/ereuse_devicehub/config.py @@ -51,6 +51,7 @@ class DevicehubConfig(Config): TMP_SNAPSHOTS = config('TMP_SNAPSHOTS', '/tmp/snapshots') TMP_LIVES = config('TMP_LIVES', '/tmp/lives') + LICENCES = config('LICENCES', './licences.txt') """This var is for save a snapshots in json format when fail something""" API_DOC_CONFIG_TITLE = 'Devicehub' API_DOC_CONFIG_VERSION = '0.2' diff --git a/ereuse_devicehub/resources/licences/licences.py b/ereuse_devicehub/resources/licences/licences.py index 8742d29a..f664fe4e 100644 --- a/ereuse_devicehub/resources/licences/licences.py +++ b/ereuse_devicehub/resources/licences/licences.py @@ -7,7 +7,9 @@ class LicenceView(View): def get(self, *args, **kwargs): """Get version of DeviceHub and ereuse-tag.""" - with open('licences.txt') as f: + app = self.resource_def.app + path_licences = app.config['LICENCES'] + with open(path_licences) as f: licences = f.read() ret = jsonify(licences)