From 9f9eae70f16a1f233b9a8b8823a1e803a77ed20b Mon Sep 17 00:00:00 2001 From: Mojtaba-z Date: Wed, 3 Dec 2025 09:53:09 +0330 Subject: [PATCH] fix - edit quota bug on org --- apps/product/models.py | 1 + apps/product/web/api/v1/serializers/quota_serializers.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/apps/product/models.py b/apps/product/models.py index a8342cf..1e425d3 100644 --- a/apps/product/models.py +++ b/apps/product/models.py @@ -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 diff --git a/apps/product/web/api/v1/serializers/quota_serializers.py b/apps/product/web/api/v1/serializers/quota_serializers.py index 565b82c..6c6c508 100644 --- a/apps/product/web/api/v1/serializers/quota_serializers.py +++ b/apps/product/web/api/v1/serializers/quota_serializers.py @@ -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(