fix bug of rancher plan id

This commit is contained in:
2025-09-25 12:44:11 +03:30
parent 8571ef0c68
commit a44be5bbc4
2 changed files with 2 additions and 2 deletions

View File

@@ -47,7 +47,7 @@ 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,
'id': rancher_plan.first().allowed_quantity if rancher_plan.exists() else None,
'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 "",