fix - admin can see registere org quotas
This commit is contained in:
@@ -469,12 +469,21 @@ class Quota(BaseModel):
|
||||
"""
|
||||
get stats of quota from org quota stat model
|
||||
"""
|
||||
|
||||
stat = OrganizationQuotaStats.objects.filter(
|
||||
quota=self,
|
||||
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
|
||||
org_childs = get_all_org_child(org) # noqa
|
||||
|
||||
|
||||
Reference in New Issue
Block a user