add - new pricing attr system
This commit is contained in:
@@ -7,7 +7,6 @@ class QuotaStatsService:
|
||||
@staticmethod
|
||||
def apply_distribution(distribution: QuotaDistribution):
|
||||
quota = distribution.quota
|
||||
print("ssss")
|
||||
# origin org
|
||||
assigner = distribution.assigner_organization
|
||||
# destination org
|
||||
@@ -24,10 +23,12 @@ class QuotaStatsService:
|
||||
organization=assigner,
|
||||
quota=quota,
|
||||
)
|
||||
print(assigner_stat.id)
|
||||
if created:
|
||||
assigner_stat.stat_type = 'distribution'
|
||||
assigner_stat.save()
|
||||
if assigner_stat.stat_type == 'distribution':
|
||||
print(assigner_stat.remaining_amount)
|
||||
assigner_stat.remaining_amount -= distribution.weight
|
||||
assigner_stat.total_distributed += distribution.weight
|
||||
assigner_stat.save()
|
||||
@@ -38,7 +39,7 @@ class QuotaStatsService:
|
||||
quota=quota,
|
||||
stat_type='distribution'
|
||||
)
|
||||
|
||||
print(distribution._request) # noqa
|
||||
assigned_stat.total_amount += distribution.weight
|
||||
assigned_stat.remaining_amount += distribution.weight
|
||||
assigned_stat.distributions.add(distribution)
|
||||
|
||||
Reference in New Issue
Block a user