fix - distribution dashboard remaining weight
This commit is contained in:
@@ -4,7 +4,7 @@ from django.db.models.functions import Coalesce
|
||||
|
||||
from apps.authentication.models import Organization
|
||||
from apps.core.services.filter.search import DynamicSearchService
|
||||
from apps.product.models import OrganizationQuotaStats, QuotaDistribution
|
||||
from apps.product.models import OrganizationQuotaStats, QuotaDistribution, Quota
|
||||
|
||||
|
||||
class QuotaDashboardService:
|
||||
@@ -41,8 +41,11 @@ class QuotaDashboardService:
|
||||
**base_filter
|
||||
)
|
||||
dist_org_quota_stats = OrganizationQuotaStats.objects.filter(
|
||||
quota__in=Quota.objects.filter(
|
||||
Q(registerer_organization=org) |
|
||||
Q(assigned_organizations=org)
|
||||
).distinct('id'),
|
||||
stat_type='distribution',
|
||||
organization=org,
|
||||
**base_filter
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user