aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfengyuanxing <feng.yuanxing@zte.com.cn>2018-01-25 10:37:36 +0800
committerfengyuanxing <feng.yuanxing@zte.com.cn>2018-01-25 10:37:36 +0800
commit3f537fa5c295cd7a03ff1115930cef7aa37e49ec (patch)
treec047d54256fb4489dbd15f7b66381ae62eb024db
parent8164afb33e6cb6725e0677c9cda13af43de3d5ba (diff)
Modify hard code to status constants
Change-Id: Ib61211f3c3f8d8ddf33b3d8873ce642ad72462f5 Issue-ID: VFC-675 Signed-off-by: fengyuanxing <feng.yuanxing@zte.com.cn>
-rw-r--r--catalog/jobs/views.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/catalog/jobs/views.py b/catalog/jobs/views.py
index 458ddc5b..a46d75af 100644
--- a/catalog/jobs/views.py
+++ b/catalog/jobs/views.py
@@ -18,6 +18,7 @@ from drf_yasg import openapi
from drf_yasg.utils import swagger_auto_schema
from rest_framework.response import Response
from rest_framework.views import APIView
+from rest_framework import status
from catalog.jobs.job_get import GetJobInfoService
from catalog.pub.utils.jobutil import JobUtil
from catalog.pub.utils.values import ignore_case_get
@@ -35,7 +36,7 @@ class JobView(APIView):
@swagger_auto_schema(
operation_description="Get job status",
manual_parameters=[input_job_id, input_response_id],
- responses={200: JobResponseSerializer()})
+ responses={status.HTTP_200_OK: JobResponseSerializer()})
def get(self, request, job_id):
response_id = ignore_case_get(request.META, 'responseId')
ret = GetJobInfoService(job_id, response_id).do_biz()
@@ -45,8 +46,8 @@ class JobView(APIView):
operation_description="Update job status",
manual_parameters=[input_job_id, input_response_id],
responses={
- 202: PostJobResponseSerializer(),
- 500: PostJobResponseSerializer()
+ status.HTTP_202_ACCEPTED: PostJobResponseSerializer(),
+ status.HTTP_500_INTERNAL_SERVER_ERROR: PostJobResponseSerializer()
}
)
def post(self, request, job_id):