Fix: Don't automatically persist or return _config_version
Should only ever be read or written by the plugin system itself, not by on_settings_save or on_settings_load
This commit is contained in:
1 parent
8d10be6ac4
commit
77f7d59c53
1 file changed
+9
-3
@@ -781,7 +781,10 @@ class SettingsPlugin(OctoPrintPlugin):
|
|||||||
|
|
||||||
:return: the current settings of the plugin, as a dictionary
|
:return: the current settings of the plugin, as a dictionary
|
||||||
"""
|
"""
|
||||||
return self._settings.get([], asdict=True, merged=True)
|
data = self._settings.get([], asdict=True, merged=True)
|
||||||
|
if "_config_version" in data:
|
||||||
|
del data["_config_version"]
|
||||||
|
return data
|
||||||
|
|
||||||
def on_settings_save(self, data):
|
def on_settings_save(self, data):
|
||||||
"""
|
"""
|
||||||
@@ -803,9 +806,12 @@ class SettingsPlugin(OctoPrintPlugin):
|
|||||||
"""
|
"""
|
||||||
import octoprint.util
|
import octoprint.util
|
||||||
|
|
||||||
|
if "_config_version" in data:
|
||||||
|
del data["_config_version"]
|
||||||
|
|
||||||
current = self._settings.get([], asdict=True, merged=True)
|
current = self._settings.get([], asdict=True, merged=True)
|
||||||
data = octoprint.util.dict_merge(current, data)
|
merged = octoprint.util.dict_merge(current, data)
|
||||||
self._settings.set([], data)
|
self._settings.set([], merged)
|
||||||
|
|
||||||
def get_settings_defaults(self):
|
def get_settings_defaults(self):
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in new issue
Block a user