mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Remove incorrect validation routine
This commit is contained in:
parent
11f541303b
commit
55ff026696
@ -492,22 +492,6 @@ class BomItemSerializer(InvenTreeModelSerializer):
|
|||||||
|
|
||||||
purchase_price_range = serializers.SerializerMethodField()
|
purchase_price_range = serializers.SerializerMethodField()
|
||||||
|
|
||||||
def validate(self, data):
|
|
||||||
|
|
||||||
# Check for duplicate BOM items
|
|
||||||
part = data['part']
|
|
||||||
sub_part = data['sub_part']
|
|
||||||
|
|
||||||
if BomItem.objects.filter(part=part, sub_part=sub_part).exists():
|
|
||||||
raise serializers.ValidationError({
|
|
||||||
'part': _("Duplicate BOM item already exists"),
|
|
||||||
'sub_part': _("Duplicate BOM items already exists"),
|
|
||||||
})
|
|
||||||
|
|
||||||
data = super().validate(data)
|
|
||||||
|
|
||||||
return data
|
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
# part_detail and sub_part_detail serializers are only included if requested.
|
# part_detail and sub_part_detail serializers are only included if requested.
|
||||||
# This saves a bunch of database requests
|
# This saves a bunch of database requests
|
||||||
|
Loading…
Reference in New Issue
Block a user