From 9375ea737823a4cbc90a9d081b37f435006e5bbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D0=BE=D1=80=D0=BE=D0=B4=D0=B8=D0=BD=20=D0=A0=D0=BE?= =?UTF-8?q?=D0=BC=D0=B0=D0=BD?= Date: Wed, 19 Sep 2018 10:57:57 +0300 Subject: [PATCH 1/2] TypeError when try to disable appliance --- applications/admin/controllers/default.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/applications/admin/controllers/default.py b/applications/admin/controllers/default.py index 28198d2a..211ed36f 100644 --- a/applications/admin/controllers/default.py +++ b/applications/admin/controllers/default.py @@ -562,7 +562,11 @@ def enable(): os.unlink(filename) return SPAN(T('Disable'), _style='color:green') else: - safe_open(filename, 'wb').write('disabled: True\ntime-disabled: %s' % request.now) + if PY2: + safe_open(filename, 'wb').write('disabled: True\ntime-disabled: %s' % request.now) + else: + str_ = 'disabled: True\ntime-disabled: %s' % request.now + safe_open(filename, 'wb').write(str_.encode('utf-8')) return SPAN(T('Enable'), _style='color:red') From fba90d31f4925c078b11eadc8c39d5842483ea96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D0=BE=D1=80=D0=BE=D0=B4=D0=B8=D0=BD=20=D0=A0=D0=BE?= =?UTF-8?q?=D0=BC=D0=B0=D0=BD?= Date: Wed, 19 Sep 2018 11:06:04 +0300 Subject: [PATCH 2/2] Error 'dict_items += list' when try to save code-editor settings --- applications/admin/controllers/default.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/applications/admin/controllers/default.py b/applications/admin/controllers/default.py index 211ed36f..4a142f22 100644 --- a/applications/admin/controllers/default.py +++ b/applications/admin/controllers/default.py @@ -646,7 +646,10 @@ def edit(): # show settings tab and save prefernces if 'settings' in request.vars: if request.post_vars: # save new preferences - post_vars = request.post_vars.items() + if PY2: + post_vars = request.post_vars.items() + else: + post_vars = list(request.post_vars.items()) # Since unchecked checkbox are not serialized, we must set them as false by hand to store the correct preference in the settings post_vars += [(opt, 'false') for opt in preferences if opt not in request.post_vars] if config.save(post_vars):