仪表盘全局组织报500错误

pull/6130/head^2
fghbng@qq.com 2021-05-17 13:40:39 +08:00 committed by Jiangjie.Bai
parent d2dc2ab02c
commit 20dacea260
2 changed files with 4 additions and 0 deletions

View File

@ -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')

View File

@ -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