Selaa lähdekoodia

修复task无法显示company_name的bug

bigcat 1 vuosi sitten
vanhempi
commit
7997e10594
1 muutettua tiedostoa jossa 5 lisäystä ja 5 poistoa
  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,