some changes in stat / permissions add modify state
This commit is contained in:
@@ -268,6 +268,7 @@ def organization_quota_stats(sender, instance: Quota, created: bool, **kwargs):
|
||||
)
|
||||
org_quota_stat.total_amount = instance.quota_weight
|
||||
org_quota_stat.save(update_fields=['total_amount'])
|
||||
org_quota_stat.update_amount()
|
||||
|
||||
# delete quota
|
||||
if instance.trash:
|
||||
@@ -293,7 +294,7 @@ def update_quota_stats_on_distribution(sender, instance: QuotaDistribution, crea
|
||||
organization=org,
|
||||
)
|
||||
stats.distributions.add(instance)
|
||||
stats.update_amount()
|
||||
stats.update_amount(main_quota=True)
|
||||
instance.one_time_loop_flag = True
|
||||
|
||||
|
||||
@@ -314,6 +315,6 @@ def handle_quota_stats_soft_delete_on_distribution(sender, instance: QuotaDistri
|
||||
if stats_qs:
|
||||
for stats in stats_qs:
|
||||
stats.distributions.remove(instance)
|
||||
stats.update_amount()
|
||||
stats.update_amount(main_quota=True)
|
||||
|
||||
instance.one_time_loop_flag = True
|
||||
|
||||
Reference in New Issue
Block a user