From 659e20d5f5d176092e17a88872238c1f7ad77174 Mon Sep 17 00:00:00 2001 From: Luke Murphy Date: Thu, 1 Aug 2019 16:51:04 +0200 Subject: [PATCH] Import DATA_DIR correctly Fix for f6bfabc7aa5845f36731a7f7a2cda6c6452a9510. --- moulinette/interfaces/api.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/moulinette/interfaces/api.py b/moulinette/interfaces/api.py index 17c00a1f..79a31f4a 100644 --- a/moulinette/interfaces/api.py +++ b/moulinette/interfaces/api.py @@ -13,7 +13,7 @@ from geventwebsocket import WebSocketError from bottle import run, request, response, Bottle, HTTPResponse from bottle import abort -from moulinette import msignals, m18n, DATA_DIR +from moulinette import msignals, m18n, env from moulinette.core import MoulinetteError, clean_session from moulinette.interfaces import ( BaseActionsMapParser, BaseInterface, ExtendedArgumentParser, @@ -789,6 +789,8 @@ class Interface(BaseInterface): category -- Name of the category """ + DATA_DIR = env()['DATA_DIR'] + if category is None: with open('%s/../doc/resources.json' % DATA_DIR) as f: return f.read()