mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-06-24 05:57:31 +00:00
仪表盘全局组织报500错误
This commit is contained in:
parent
d2dc2ab02c
commit
20dacea260
@ -221,6 +221,8 @@ class IndexApi(DatesLoginMetricMixin, APIView):
|
||||
query_params = self.request.query_params
|
||||
|
||||
caches = OrgResourceStatisticsCache(current_org)
|
||||
if current_org.is_root():
|
||||
caches.refresh()
|
||||
|
||||
_all = query_params.get('all')
|
||||
|
||||
|
@ -87,6 +87,8 @@ class OrgResourceStatisticsCache(OrgRelatedCache):
|
||||
return users_amount
|
||||
|
||||
def compute_assets_amount(self):
|
||||
if self.org.is_root():
|
||||
return Asset.objects.all().count()
|
||||
node = Node.org_root()
|
||||
return node.assets_amount
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user