fix - admin can see registere org quotas

This commit is contained in:
2025-11-29 09:33:22 +03:30
parent 8d7d9db014
commit e59040c360

View File

@@ -469,12 +469,21 @@ class Quota(BaseModel):
""" """
get stats of quota from org quota stat model get stats of quota from org quota stat model
""" """
stat = OrganizationQuotaStats.objects.filter( stat = OrganizationQuotaStats.objects.filter(
quota=self, quota=self,
organization=org organization=org
) )
if not stat.exists(): if not stat.exists() and org.type.key == 'ADM':
# if org is admin just see the quota was created by registerer org
org = self.registerer_organization
stat = OrganizationQuotaStats.objects.filter(
quota=self,
organization=org
)
elif not stat.exists():
# get childs of organization # get childs of organization
org_childs = get_all_org_child(org) # noqa org_childs = get_all_org_child(org) # noqa