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:
parent
8d10be6ac4
commit
77f7d59c53
1 changed files with 9 additions and 3 deletions
|
|
@ -781,7 +781,10 @@ class SettingsPlugin(OctoPrintPlugin):
|
|||
|
||||
: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):
|
||||
"""
|
||||
|
|
@ -803,9 +806,12 @@ class SettingsPlugin(OctoPrintPlugin):
|
|||
"""
|
||||
import octoprint.util
|
||||
|
||||
if "_config_version" in data:
|
||||
del data["_config_version"]
|
||||
|
||||
current = self._settings.get([], asdict=True, merged=True)
|
||||
data = octoprint.util.dict_merge(current, data)
|
||||
self._settings.set([], data)
|
||||
merged = octoprint.util.dict_merge(current, data)
|
||||
self._settings.set([], merged)
|
||||
|
||||
def get_settings_defaults(self):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Reference in a new issue