fix: 修复 default 组织用户数量统计错误

pull/6164/head
xinwen 4 years ago committed by Jiangjie.Bai
parent 34d46897f8
commit c66f366446

@ -78,12 +78,12 @@ class OrgResourceStatisticsCache(OrgRelatedCache):
return self.org return self.org
def compute_users_amount(self): def compute_users_amount(self):
if self.org.is_root(): users = User.objects.exclude(role='App')
users_amount = User.objects.exclude(role='App').count()
else: if not self.org.is_root():
users_amount = OrganizationMember.objects.values( users = users.filter(m2m_org_members__org_id=self.org.id)
'user_id'
).filter(org_id=self.org.id).distinct().count() users_amount = users.values('id').distinct().count()
return users_amount return users_amount
def compute_assets_amount(self): def compute_assets_amount(self):

Loading…
Cancel
Save