Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chats must be provided as dict on settings #52

Merged
merged 2 commits into from
Dec 13, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions octoprint_telegram/__init__.py
Original file line number Diff line number Diff line change
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 Expand Up @@ -1172,4 +1172,4 @@ def route_hook(self, server_routes, *args, **kwargs):
__plugin_hooks__ = {
"octoprint.plugin.softwareupdate.check_config": __plugin_implementation__.get_update_information,
"octoprint.server.http.routes": __plugin_implementation__.route_hook
}
}