feat: fmlog创建时校验
This commit is contained in:
parent
170f3db824
commit
233591728a
|
@ -607,6 +607,15 @@ class FmlogSerializer(CustomModelSerializer):
|
|||
model = Fmlog
|
||||
fields = '__all__'
|
||||
read_only_fields = EXCLUDE_FIELDS
|
||||
|
||||
def validate(self, attrs):
|
||||
route: Route = attrs['route']
|
||||
mtask: Mtask = attrs['mtask']
|
||||
mgroup: Mgroup = attrs['mgroup']
|
||||
if route.process != mgroup.process:
|
||||
raise ParseError('工序不匹配')
|
||||
if mtask.mgroup != mgroup:
|
||||
raise ParseError('工段不匹配')
|
||||
|
||||
class FmlogUpdateSerializer(CustomModelSerializer):
|
||||
class Meta:
|
||||
|
|
Loading…
Reference in New Issue