From 6268e27dd784cea889e14e2378cf1cf464832cfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Thu, 19 Jan 2017 12:31:08 +0100 Subject: [PATCH] Fix settings not allowing to delete values not in defaults anymore --- src/octoprint/settings.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/octoprint/settings.py b/src/octoprint/settings.py index e52bac7a..9a80273b 100644 --- a/src/octoprint/settings.py +++ b/src/octoprint/settings.py @@ -1396,13 +1396,18 @@ class Settings(object): try: current = chain.get_by_path(path) + except KeyError: + current = None + + try: default_value = chain.get_by_path(path, only_defaults=True) - in_local = chain.has_path(path, only_local=True) - in_defaults = chain.has_path(path, only_defaults=True) except KeyError: if error_on_path: raise NoSuchSettingsPath() - return + default_value = None + + in_local = chain.has_path(path, only_local=True) + in_defaults = chain.has_path(path, only_defaults=True) if not force and in_defaults and in_local and default_value == value: try: