fix - edit quota bug on org

This commit is contained in:
2025-12-03 09:53:09 +03:30
parent 3da9368c9c
commit 9f9eae70f1
2 changed files with 3 additions and 0 deletions

View File

@@ -546,6 +546,7 @@ class Quota(BaseModel):
quota=self,
organization=org
)
# first quota created is none stat on attribute & broker value table
if stat.first().stat_type == 'quota':
return None

View File

@@ -61,6 +61,8 @@ class QuotaSerializer(serializers.ModelSerializer):
representation['assigned_organizations'] = [{
"name": org.name, "id": org.id
} for org in assigned_orgs]
else:
org = None
if instance.sale_unit:
representation['sale_unit'] = product_serializers.SaleUnitSerializer(