Merge pull request #2253 from jumpserver/dev

Bugfix (#2252)
pull/2328/head
老广 6 years ago committed by GitHub
commit a14d6b298d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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…
Cancel
Save