瀏覽代碼

修复task无法显示company_name的bug

bigcat 1 年之前
父節點
當前提交
7997e10594
共有 1 個文件被更改,包括 5 次插入5 次删除
  1. 5 5
      apps/task/views/taskview.py

+ 5 - 5
apps/task/views/taskview.py

@@ -94,11 +94,11 @@ class TaskView(APIView):
         executor, action, method = get_log(request)
         gen_log(action, "测试任务", task.title, method, executor)
         company_name = ''
-        # try:
-        company = Company.objects.get(id=task.company_id)
-        company_name = company.name
-        # except:
-        #     pass
+        try:
+            company = Company.objects.get(id=task.company_id)
+            company_name = company.name
+        except:
+            pass
 
         return Response({
             'software_id': task.plan.software.id,