fix pos inventory serializer context rancher key

This commit is contained in:
2025-08-30 10:47:16 +03:30
parent 5b0d6ac8ee
commit 91f69c171b

View File

@@ -57,7 +57,7 @@ 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'])