7
0
mirror of https://github.com/ChristianLight/tutor.git synced 2024-06-18 13:22:22 +00:00

Update env renderer on config change

We have a side effect whenever we add a plugin manually to the tutor
configuration: the renderer does not update itself. We fix this by
checking the config at load time.
This commit is contained in:
Régis Behmo 2019-07-10 15:19:20 +08:00
parent 50f5af989c
commit 7fbba104a1

View File

@ -17,10 +17,12 @@ VERSION_FILENAME = "version"
class Renderer:
ENVIRONMENT = None
ENVIRONMENT_CONFIG = None
@classmethod
def environment(cls, config):
if not cls.ENVIRONMENT:
if cls.ENVIRONMENT_CONFIG != config:
cls.ENVIRONMENT_CONFIG = config
template_roots = [TEMPLATES_ROOT]
for _, plugin_templates in plugins.iter_templates(config):
template_roots.append(plugin_templates)