From 883c2851ffb864d825aecdeb6384cbb1422e292f Mon Sep 17 00:00:00 2001
From: shortcutme <tamas@zeronet.io>
Date: Sat, 16 Mar 2019 02:20:32 +0100
Subject: [PATCH] Py3 compatibility of ContentFilter plugin

---
 plugins/ContentFilter/ContentFilterStorage.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/plugins/ContentFilter/ContentFilterStorage.py b/plugins/ContentFilter/ContentFilterStorage.py
index 84908e09..3df0b435 100644
--- a/plugins/ContentFilter/ContentFilterStorage.py
+++ b/plugins/ContentFilter/ContentFilterStorage.py
@@ -105,7 +105,7 @@ class ContentFilterStorage(object):
 
     def save(self):
         s = time.time()
-        helper.atomicWrite(self.file_path, json.dumps(self.file_content, indent=2, sort_keys=True))
+        helper.atomicWrite(self.file_path, json.dumps(self.file_content, indent=2, sort_keys=True).encode("utf8"))
         self.log.debug("Saved in %.3fs" % (time.time() - s))
 
     def isMuted(self, auth_address):
@@ -123,7 +123,7 @@ class ContentFilterStorage(object):
     # Search and remove or readd files of an user
     def changeDbs(self, auth_address, action):
         self.log.debug("Mute action %s on user %s" % (action, auth_address))
-        res = self.site_manager.list().values()[0].content_manager.contents.db.execute(
+        res = list(self.site_manager.list().values())[0].content_manager.contents.db.execute(
             "SELECT * FROM content LEFT JOIN site USING (site_id) WHERE inner_path LIKE :inner_path",
             {"inner_path": "%%/%s/%%" % auth_address}
         )