add - new pricing attr system

This commit is contained in:
2025-12-02 09:58:30 +03:30
parent 988e3aa1dd
commit e63c6b9b8d
6 changed files with 52 additions and 12 deletions

View File

@@ -32,12 +32,14 @@ class QuotaStatsValidator:
"""
if organization has enough remaining weight
"""
if assigner_org.type.key == "ADM":
assigner_org = quota.registerer_organization
stat = QuotaStatsValidator._get_stat(quota, assigner_org)
if not stat:
raise DistributionException(
f"سازمان {assigner_org.name} هیچ مدل میانی برای این سهمیه {quota} ندارد .", # noqa
status.HTTP_403_FORBIDDEN
)
status.HTTP_403_FORBIDDEN)
remaining = getattr(stat, "remaining_amount", None)
if remaining is None: