From e7725e691045a4bbec4fa6eec6ee5937bb7bac14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=81=E5=B9=BF?= Date: Fri, 21 Dec 2018 15:47:52 +0800 Subject: [PATCH] Bugfix (#2252) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [Update] 修改心跳偶人时间 * [Update] 修改Node比较 * [Bugfix] 修复bug --- apps/common/models.py | 4 ++-- apps/common/tree.py | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/common/models.py b/apps/common/models.py index cb97b8988..012cd7351 100644 --- a/apps/common/models.py +++ b/apps/common/models.py @@ -45,10 +45,10 @@ class Setting(models.Model): def cleaned_value(self): try: value = self.value - if not isinstance(value, (str, bytes)): - return value if self.encrypted: value = signer.unsign(value) + if not value: + return None value = json.loads(value) return value except json.JSONDecodeError: diff --git a/apps/common/tree.py b/apps/common/tree.py index 6b57a3db4..13756a35d 100644 --- a/apps/common/tree.py +++ b/apps/common/tree.py @@ -49,7 +49,9 @@ class TreeNode: return False elif not self.isParent and other.isParent: return True - return self.id > other.id + if self.pId != other.pId: + return self.pId > other.pId + return self.name > other.name def __eq__(self, other): return self.id == other.id