diff --git a/apps/warehouse/pos/api/v1/serializers.py b/apps/warehouse/pos/api/v1/serializers.py index e4262ec..17b37c9 100644 --- a/apps/warehouse/pos/api/v1/serializers.py +++ b/apps/warehouse/pos/api/v1/serializers.py @@ -57,14 +57,14 @@ class InventoryEntrySerializer(serializers.ModelSerializer): 'id': instance.distribution.quota.product.id, } - if self.context['rancher']: + if 'rancher' in self.context.keys(): # rancher herd & live stock statistics representation['rancher_statistics'] = get_rancher_statistics(self.context['rancher']) - # rancher live stock statistics by inventory entry - representation['rancher_quota_weight_statistics'] = rancher_quota_weight( - self.context['rancher'], instance - ) + # rancher live stock statistics by inventory entry + representation['rancher_quota_weight_statistics'] = rancher_quota_weight( + self.context['rancher'], instance + ) return representation