fix pos inventory serializer context rancher key
This commit is contained in:
@@ -57,14 +57,14 @@ class InventoryEntrySerializer(serializers.ModelSerializer):
|
|||||||
'id': instance.distribution.quota.product.id,
|
'id': instance.distribution.quota.product.id,
|
||||||
}
|
}
|
||||||
|
|
||||||
if self.context['rancher']:
|
if 'rancher' in self.context.keys():
|
||||||
# rancher herd & live stock statistics
|
# rancher herd & live stock statistics
|
||||||
representation['rancher_statistics'] = get_rancher_statistics(self.context['rancher'])
|
representation['rancher_statistics'] = get_rancher_statistics(self.context['rancher'])
|
||||||
|
|
||||||
# rancher live stock statistics by inventory entry
|
# rancher live stock statistics by inventory entry
|
||||||
representation['rancher_quota_weight_statistics'] = rancher_quota_weight(
|
representation['rancher_quota_weight_statistics'] = rancher_quota_weight(
|
||||||
self.context['rancher'], instance
|
self.context['rancher'], instance
|
||||||
)
|
)
|
||||||
|
|
||||||
return representation
|
return representation
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user