mirror of https://github.com/jumpserver/jumpserver
parent
5fab276c26
commit
f994c4d1da
|
@ -518,7 +518,10 @@ class Nav(object):
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_max_asset_property_length(assets, property_='hostname'):
|
def get_max_asset_property_length(assets, property_='hostname'):
|
||||||
return max([len(getattr(asset, property_)) for asset in assets])
|
try:
|
||||||
|
return max([len(getattr(asset, property_)) for asset in assets])
|
||||||
|
except ValueError:
|
||||||
|
return 30
|
||||||
|
|
||||||
def print_search_result(self):
|
def print_search_result(self):
|
||||||
hostname_max_length = self.get_max_asset_property_length(self.search_result)
|
hostname_max_length = self.get_max_asset_property_length(self.search_result)
|
||||||
|
|
Loading…
Reference in New Issue