From 6f2c8c1e2bac67fbad5205dc948270f91323ee73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Mon, 14 Jun 2021 11:21:47 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20TEMPLATES=5FAUTO=5FRELOAD?= =?UTF-8?q?=20not=20being=20honored?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now stuff should reload properly again on change. --- src/octoprint/server/__init__.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/octoprint/server/__init__.py b/src/octoprint/server/__init__.py index 810001c6f..a2dde3b46 100644 --- a/src/octoprint/server/__init__.py +++ b/src/octoprint/server/__init__.py @@ -1348,14 +1348,16 @@ class Server(object): ReverseProxiedEnvironment, ) - s = settings() + app.config["TEMPLATES_AUTO_RELOAD"] = True + app.config["JSONIFY_PRETTYPRINT_REGULAR"] = False + + # we must not set this before TEMPLATES_AUTO_RELOAD is set to True or that won't take + app.debug = self._debug # setup octoprint's flask json serialization/deserialization app.json_encoder = OctoPrintJsonEncoder - app.debug = self._debug - app.config["TEMPLATES_AUTO_RELOAD"] = True - app.config["JSONIFY_PRETTYPRINT_REGULAR"] = False + s = settings() secret_key = s.get(["server", "secretKey"]) if not secret_key: