From 2152184bf90407f563bc983188a8c508eae3bc50 Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Sat, 1 May 2021 16:49:53 +0200 Subject: [PATCH] fix compatibility issues with python 3.5 --- owrx/controllers/settings/bookmarks.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/owrx/controllers/settings/bookmarks.py b/owrx/controllers/settings/bookmarks.py index 771f120..2704bb6 100644 --- a/owrx/controllers/settings/bookmarks.py +++ b/owrx/controllers/settings/bookmarks.py @@ -97,7 +97,7 @@ class BookmarksController(AuthorizationMixin, BreadcrumbMixin, WebpageController self.send_response("{}", content_type="application/json", code=404) return try: - data = json.loads(self.get_body()) + data = json.loads(self.get_body().decode("utf-8")) for key in ["name", "frequency", "modulation"]: if key in data: value = data[key] @@ -126,7 +126,7 @@ class BookmarksController(AuthorizationMixin, BreadcrumbMixin, WebpageController return {"bookmark_id": id(bookmark)} try: - data = json.loads(self.get_body()) + data = json.loads(self.get_body().decode("utf-8")) result = [create(b) for b in data] bookmarks.store() self.send_response(json.dumps(result), content_type="application/json", code=200)