mirror of https://github.com/jumpserver/jumpserver
parent
ac9178cb93
commit
e7725e6910
|
@ -45,10 +45,10 @@ class Setting(models.Model):
|
||||||
def cleaned_value(self):
|
def cleaned_value(self):
|
||||||
try:
|
try:
|
||||||
value = self.value
|
value = self.value
|
||||||
if not isinstance(value, (str, bytes)):
|
|
||||||
return value
|
|
||||||
if self.encrypted:
|
if self.encrypted:
|
||||||
value = signer.unsign(value)
|
value = signer.unsign(value)
|
||||||
|
if not value:
|
||||||
|
return None
|
||||||
value = json.loads(value)
|
value = json.loads(value)
|
||||||
return value
|
return value
|
||||||
except json.JSONDecodeError:
|
except json.JSONDecodeError:
|
||||||
|
|
|
@ -49,7 +49,9 @@ class TreeNode:
|
||||||
return False
|
return False
|
||||||
elif not self.isParent and other.isParent:
|
elif not self.isParent and other.isParent:
|
||||||
return True
|
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):
|
def __eq__(self, other):
|
||||||
return self.id == other.id
|
return self.id == other.id
|
||||||
|
|
Loading…
Reference in New Issue