车间操作bug
This commit is contained in:
parent
fd2141598e
commit
32018645ca
|
@ -552,12 +552,6 @@ class OperationMaterialInputViewSet(ListModelMixin, CreateModelMixin, DestroyMod
|
|||
return OperationMaterialCreate1Serailizer
|
||||
return super().get_serializer_class()
|
||||
|
||||
def create(self, request, *args, **kwargs):
|
||||
instance = self.get_object()
|
||||
if instance.operation.is_submited:
|
||||
raise exceptions.APIException('该操作已提交')
|
||||
return super().create(request, *args, **kwargs)
|
||||
|
||||
@transaction.atomic()
|
||||
def destroy(self, request, *args, **kwargs):
|
||||
instance = self.get_object()
|
||||
|
@ -582,12 +576,6 @@ class OperationMaterialOutputViewSet(ListModelMixin, CreateModelMixin, DestroyMo
|
|||
return OperationMaterialCreate2Serailizer
|
||||
return super().get_serializer_class()
|
||||
|
||||
def create(self, request, *args, **kwargs):
|
||||
instance = self.get_object()
|
||||
if instance.operation.is_submited:
|
||||
raise exceptions.APIException('该操作已提交')
|
||||
return super().create(request, *args, **kwargs)
|
||||
|
||||
@transaction.atomic()
|
||||
def destroy(self, request, *args, **kwargs):
|
||||
instance = self.get_object()
|
||||
|
@ -612,12 +600,6 @@ class OperationMaterialToolViewSet(ListModelMixin, CreateModelMixin, DestroyMode
|
|||
return OperationMaterialCreate3Serializer
|
||||
return super().get_serializer_class()
|
||||
|
||||
def create(self, request, *args, **kwargs):
|
||||
instance = self.get_object()
|
||||
if instance.operation.is_submited:
|
||||
raise exceptions.APIException('该操作已提交')
|
||||
return super().create(request, *args, **kwargs)
|
||||
|
||||
@transaction.atomic()
|
||||
def destroy(self, request, *args, **kwargs):
|
||||
instance = self.get_object()
|
||||
|
|
Loading…
Reference in New Issue