feat: route create update 强校验3
This commit is contained in:
parent
6b3a34879e
commit
c541e58006
|
@ -258,6 +258,7 @@ class RouteSerializer(CustomModelSerializer):
|
|||
if rx.routepack:
|
||||
msg = rx.routepack.name
|
||||
raise ParseError(f"该工艺步骤已存在-{msg}")
|
||||
instance.save()
|
||||
return instance
|
||||
|
||||
def update(self, instance, validated_data):
|
||||
|
@ -286,6 +287,7 @@ class RouteSerializer(CustomModelSerializer):
|
|||
if rx.routepack:
|
||||
msg = rx.routepack.name
|
||||
raise ParseError(f"该工艺步骤已存在-{msg}")
|
||||
instance.save()
|
||||
return instance
|
||||
|
||||
def to_representation(self, instance):
|
||||
|
|
Loading…
Reference in New Issue