Fix bug for BuildItem with no part image

- Can't request a field what don't exist
This commit is contained in:
Oliver Walters 2019-06-03 21:25:37 +10:00
parent aff4124d97
commit bb5ed0b9fe

View File

@ -45,7 +45,7 @@ class BuildItemSerializer(InvenTreeModelSerializer):
part = serializers.IntegerField(source='stock_item.part.pk', read_only=True) part = serializers.IntegerField(source='stock_item.part.pk', read_only=True)
part_name = serializers.CharField(source='stock_item.part.full_name', read_only=True) part_name = serializers.CharField(source='stock_item.part.full_name', read_only=True)
part_image = serializers.CharField(source='stock_item.part.image.url', read_only=True) part_image = serializers.CharField(source='stock_item.part.image', read_only=True)
stock_item_detail = StockItemSerializerBrief(source='stock_item', read_only=True) stock_item_detail = StockItemSerializerBrief(source='stock_item', read_only=True)
class Meta: class Meta: