From 7fbba104a1afe6e1dfce8a8458ecf96f45df6443 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Behmo?= Date: Wed, 10 Jul 2019 15:19:20 +0800 Subject: [PATCH] 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. --- tutor/env.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tutor/env.py b/tutor/env.py index f9f4e50..9cb2ed7 100644 --- a/tutor/env.py +++ b/tutor/env.py @@ -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)