From 6f987577f47a7fd2d1356c651ca871b4d4849061 Mon Sep 17 00:00:00 2001 From: Matthias Urlichs Date: Fri, 1 Feb 2019 17:14:10 +0100 Subject: [PATCH] missed hash_update --- src/octoprint/plugins/announcements/__init__.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/octoprint/plugins/announcements/__init__.py b/src/octoprint/plugins/announcements/__init__.py index f2ab0c93c..e4a6c4353 100644 --- a/src/octoprint/plugins/announcements/__init__.py +++ b/src/octoprint/plugins/announcements/__init__.py @@ -191,14 +191,16 @@ class AnnouncementPlugin(octoprint.plugin.AssetPlugin, def etag(): import hashlib hash = hashlib.sha1() - hash.update(repr(sorted(enabled))) - hash.update(repr(sorted(forced))) - hash.update(OCTOPRINT_VERSION) + def hash_update(value): + hash.update(value.encode("utf-8")) + hash_update(repr(sorted(enabled))) + hash_update(repr(sorted(forced))) + hash_update(OCTOPRINT_VERSION) for channel in sorted(channel_configs.keys()): - hash.update(repr(channel_configs[channel])) + hash_update(repr(channel_configs[channel])) channel_data = self._get_channel_data_from_cache(channel, channel_configs[channel]) - hash.update(repr(channel_data)) + hash_update(repr(channel_data)) return hash.hexdigest()