Skip to content

Commit

Permalink
chats must be provided as dict on settings
Browse files Browse the repository at this point in the history
Otherwise, if anonymously loaded first, bindings will be
generated differently.

See OctoPrint/OctoPrint#1567 for related discussion
  • Loading branch information
foosel committed Nov 21, 2016
1 parent 4908564 commit 7c19607
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions octoprint_telegram/__init__.py
Expand Up @@ -762,10 +762,10 @@ def on_settings_load(self):
data = octoprint.plugin.SettingsPlugin.on_settings_load(self)

# only return our restricted settings to admin users - this is only needed for OctoPrint <= 1.2.16
restricted = ("token", "tracking_token", "chats")
for r in restricted:
restricted = (("token", None), ("tracking_token", None), ("chats", dict())
for r, v in restricted:
if r in data and (current_user is None or current_user.is_anonymous() or not current_user.is_admin()):
data[r] = None
data[r] = v

return data

Expand Down

0 comments on commit 7c19607

Please sign in to comment.