fix - rancher statistics by herd
This commit is contained in:
@@ -3,7 +3,7 @@ from rest_framework import serializers
|
|||||||
from rest_framework.exceptions import APIException
|
from rest_framework.exceptions import APIException
|
||||||
|
|
||||||
from apps.core.models import SystemConfig
|
from apps.core.models import SystemConfig
|
||||||
from apps.herd.services.services import get_rancher_statistics, rancher_quota_weight
|
from apps.herd.services.services import rancher_quota_weight, get_rancher_statistic_by_herd
|
||||||
from apps.pos_device.services.services import pos_organizations_sharing_information
|
from apps.pos_device.services.services import pos_organizations_sharing_information
|
||||||
from apps.product import models as product_models
|
from apps.product import models as product_models
|
||||||
from apps.product.exceptions import (
|
from apps.product.exceptions import (
|
||||||
@@ -130,7 +130,7 @@ class QuotaDistributionSerializer(serializers.ModelSerializer):
|
|||||||
|
|
||||||
if 'rancher' in self.context.keys():
|
if 'rancher' in self.context.keys():
|
||||||
# rancher herd & live stock statistics
|
# rancher herd & live stock statistics
|
||||||
livestock_counts_list, livestock_counts_dict = get_rancher_statistics(rancher)
|
livestock_counts_list, livestock_counts_dict = get_rancher_statistic_by_herd(rancher)
|
||||||
representation['rancher_statistics'] = livestock_counts_list
|
representation['rancher_statistics'] = livestock_counts_list
|
||||||
|
|
||||||
# rancher live stock statistics by quota distributions
|
# rancher live stock statistics by quota distributions
|
||||||
|
|||||||
Reference in New Issue
Block a user