From b835ddde91621acf886293cfa224d8480262cad5 Mon Sep 17 00:00:00 2001 From: Robin van Genderen Date: Tue, 26 Mar 2019 12:49:24 +0100 Subject: [PATCH] load settings as json --- webapp_admin/webapp_admin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webapp_admin/webapp_admin.py b/webapp_admin/webapp_admin.py index 6a0cca2..fc5f01c 100755 --- a/webapp_admin/webapp_admin.py +++ b/webapp_admin/webapp_admin.py @@ -316,11 +316,11 @@ def import_categories(user, filename=None): if not user.store.get_prop(PR_EC_WEBAPP_PERSISTENT_SETTINGS_JSON_W): persistent_settings ={'settings': {'kopano': {'main': {'categories':data}}}} else: - persistent_settings = user.store.get_prop(PR_EC_WEBAPP_PERSISTENT_SETTINGS_JSON_W) + persistent_settings = json.loads(user.store.get_prop(PR_EC_WEBAPP_PERSISTENT_SETTINGS_JSON_W).value) persistent_settings['settings']['kopano']['main']['categories'] = data print('Restoring categories for user {}'.format(user.name)) - user.store.create_prop(PR_EC_WEBAPP_PERSISTENT_SETTINGS_JSON_W, json.dumps(persistent_settings).decode('utf-8')) + user.store.create_prop(PR_EC_WEBAPP_PERSISTENT_SETTINGS_JSON_W, json.dumps(persistent_settings)) """