Browse Source

Merge pull request #2253 from jumpserver/dev

Bugfix (#2252)
pull/2328/head
老广 6 years ago committed by GitHub
parent
commit
a14d6b298d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      apps/common/models.py
  2. 4
      apps/common/tree.py

4
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:

4
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

Loading…
Cancel
Save