From 9af4d5f76f2017cff3c5653f72b465cd9891ef95 Mon Sep 17 00:00:00 2001 From: fit2bot <68588906+fit2bot@users.noreply.github.com> Date: Mon, 16 Nov 2020 14:47:27 +0800 Subject: [PATCH] =?UTF-8?q?fix(crypto):=20=E6=9C=89=E6=97=B6=E8=A7=A3?= =?UTF-8?q?=E5=AF=86=E5=A4=B1=E8=B4=A5=20(#5003)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(nodes): 节点默认按 value 排序 * fix(crypto): 有时解密失败 Co-authored-by: xinwen --- apps/assets/models/node.py | 2 +- apps/common/utils/crypto.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/assets/models/node.py b/apps/assets/models/node.py index edfec4a32..98df6efc4 100644 --- a/apps/assets/models/node.py +++ b/apps/assets/models/node.py @@ -407,7 +407,7 @@ class Node(OrgModelMixin, SomeNodesMixin, FamilyMixin, NodeAssetsMixin): class Meta: verbose_name = _("Node") - ordering = ['key'] + ordering = ['value'] def __str__(self): return self.full_value diff --git a/apps/common/utils/crypto.py b/apps/common/utils/crypto.py index e70bd0395..6d8d876ef 100644 --- a/apps/common/utils/crypto.py +++ b/apps/common/utils/crypto.py @@ -189,7 +189,7 @@ class Crypto: if origin_text: # 有时不同算法解密不报错,但是返回空字符串 return origin_text - except (TypeError, ValueError, UnicodeDecodeError): + except (TypeError, ValueError, UnicodeDecodeError, IndexError): continue