diff --git a/apps/wpm/views.py b/apps/wpm/views.py index d7f4cc73..8d4292bb 100644 --- a/apps/wpm/views.py +++ b/apps/wpm/views.py @@ -215,8 +215,8 @@ class MlogViewSet(CustomModelViewSet): vdata_new = MlogSerializer(ins).data create_auditlog('submit', ins, vdata_new, vdata_old, now, self.request.user) - MyThread(cal_mtask_progress_from_mlog,args=(ins,)).start() - MyThread(cal_material_count_from_mlog,args=(ins,)).start() + MyThread(target=cal_mtask_progress_from_mlog,args=(ins,)).start() + MyThread(target=cal_material_count_from_mlog,args=(ins,)).start() return Response(vdata_new) @action(methods=['post'], detail=True, perms_map={'post': 'mlog.submit'}, serializer_class=MlogRevertSerializer) @@ -236,8 +236,8 @@ class MlogViewSet(CustomModelViewSet): mlog_revert(ins, user, now) create_auditlog('revert', ins, {}, {}, now, user, request.data.get('change_reason', '')) - MyThread(cal_mtask_progress_from_mlog,args=(ins,)).start() - MyThread(cal_material_count_from_mlog,args=(ins,)).start() + MyThread(target=cal_mtask_progress_from_mlog,args=(ins,)).start() + MyThread(target=cal_material_count_from_mlog,args=(ins,)).start() return Response(MlogSerializer(instance=ins).data) @action(methods=['post'], detail=False, perms_map={'post': '*'}, serializer_class=MlogRelatedSerializer)