bugfix path licences

This commit is contained in:
Cayo Puigdefabregas 2020-12-29 21:14:07 +01:00
parent 98d88fea79
commit e10985ed44
2 changed files with 4 additions and 1 deletions

View File

@ -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'

View File

@ -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)