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(