From b3d2da603683e66936c1085b589f88054dc933af Mon Sep 17 00:00:00 2001 From: Mojtaba-z Date: Thu, 25 Sep 2025 12:55:08 +0330 Subject: [PATCH] fix bug of rancher plan id --- apps/product/services/services.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/product/services/services.py b/apps/product/services/services.py index 64a6902..4c7cdd9 100644 --- a/apps/product/services/services.py +++ b/apps/product/services/services.py @@ -47,14 +47,13 @@ def quota_incentive_plans_info(quota: Quota, rancher: Rancher) -> typing.Any: ).filter(rancher=rancher, livestock_type=plan.livestock_type) incentive_plans_data = { - 'id': rancher_plan.first().allowed_quantity if rancher_plan.exists() else None, + 'id': plan.incentive_plan.id, 'name': plan.incentive_plan.name, 'livestock_type': plan.livestock_type.name if plan.livestock_type else "", 'livestock_type_en': plan.livestock_type.en_name if plan.livestock_type else "", 'livestock_weight_type': plan.livestock_type.weight_type if plan.livestock_type else "", 'quantity_kg': plan.quantity_kg, 'rancher_license_count': rancher_plan.first().allowed_quantity if rancher_plan else 0, - "incentive_plan": plan.incentive_plan.id } incentive_plans_list.append(incentive_plans_data)