Always trigger SettingsUpdated event on new save

So far it was only triggered when saving via the REST API, causing some
issues here and there.
This commit is contained in:
Gina Häußge committed 2018-11-12 11:40:21 +01:00
1 parent a939130748
commit 4548be34f0
2 files changed
+7 -6

No files matched your search

-6
View File
@@ -548,9 +548,3 @@ def _saveSettings(data):
logger.exception("Could not save settings for plugin {name} ({version})".format(version=plugin._plugin_version, name=plugin._plugin_name))
s.save()
payload = dict(
config_hash=s.config_hash,
effective_hash=s.effective_hash
)
eventManager().fire(Events.SETTINGS_UPDATED, payload=payload)
+7
View File
@@ -1334,7 +1334,14 @@ class Settings(object):
self._logger.exception("Error while saving config.yaml!")
raise
else:
from octoprint.events import eventManager, Events
self.load()
payload = dict(config_hash=self.config_hash,
effective_hash=self.effective_hash)
eventManager().fire(Events.SETTINGS_UPDATED, payload=payload)
return True
##~~ Internal getter