fix - update attribute & broker in front of org stat creation

This commit is contained in:
2025-12-02 17:29:35 +03:30
parent 8b71fe3b94
commit abb141a432
2 changed files with 4 additions and 0 deletions

View File

@@ -333,6 +333,9 @@ def organization_quota_stats(sender, instance: Quota, created: bool, **kwargs):
org_quota_stat.save(update_fields=['total_amount', 'total_distributed', 'sold_amount', 'remaining_amount'])
instance.attribute_values.all().update(org_quota_stat=org_quota_stat)
instance.broker_values.all().update(org_quota_stat=org_quota_stat)
# delete quota
if instance.trash:
org_quota_stat.soft_delete()