include MO files in build; fix module reload in ui_server

This commit is contained in:
Emily Soth 2022-12-07 13:20:47 -08:00
parent aa1a2a476f
commit 045654f851
2 changed files with 3 additions and 1 deletions

View File

@ -5,3 +5,4 @@ prune ci
prune exe
prune installer
prune workbench
include src/natcap/invest/internationalization/locales/*/LC_MESSAGES/messages.mo

View File

@ -50,7 +50,7 @@ def get_invest_models():
"""
LOGGER.debug('get model list')
set_locale(request.args.get('language', 'en'))
importlib.reload(natcap.invest)
importlib.reload(natcap.invest.model_metadata)
return cli.build_model_list_json()
@ -69,6 +69,7 @@ def get_invest_getspec():
set_locale(request.args.get('language', 'en'))
target_model = request.get_json()
target_module = MODEL_METADATA[target_model].pyname
importlib.reload(natcap.invest.spec_utils)
model_module = importlib.reload(
importlib.import_module(name=target_module))
return spec_utils.serialize_args_spec(model_module.ARGS_SPEC)