mirror of https://github.com/jumpserver/jumpserver
[Bugfix] 修复管理用户无法查看的bug
parent
870b863136
commit
91863107d7
|
@ -175,15 +175,12 @@ class AdminUser(AssetUser):
|
||||||
return info
|
return info
|
||||||
|
|
||||||
def get_related_assets(self):
|
def get_related_assets(self):
|
||||||
assets = []
|
assets = self.asset_set.all()
|
||||||
for cluster in self.cluster_set.all():
|
return assets
|
||||||
assets.extend(cluster.assets.all())
|
|
||||||
assets.extend(self.asset_set.all())
|
|
||||||
return list(set(assets))
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def assets_amount(self):
|
def assets_amount(self):
|
||||||
return len(self.get_related_assets())
|
return self.get_related_assets().count()
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
ordering = ['name']
|
ordering = ['name']
|
||||||
|
|
Loading…
Reference in New Issue