正在显示
1 个修改的文件
包含
3 行增加
和
3 行删除
@@ -35,14 +35,14 @@ class CreateProject(CreateAPIView): | @@ -35,14 +35,14 @@ class CreateProject(CreateAPIView): | ||
35 | if not serializer.is_valid(): | 35 | if not serializer.is_valid(): |
36 | raise ValidationError(serializer.errors) | 36 | raise ValidationError(serializer.errors) |
37 | else: | 37 | else: |
38 | - obj_dict = serializer.validated_data | ||
39 | - auditors = Auditor.objects.filter(type=obj_dict['type']).order_by('order') | 38 | + auditors = Auditor.objects.filter(type=int(request.data['type'])).order_by('order') |
40 | serializer.save(creator=request.user, auditor=auditors) | 39 | serializer.save(creator=request.user, auditor=auditors) |
40 | + obj_dict = serializer.data | ||
41 | # 企业微信推送 | 41 | # 企业微信推送 |
42 | for i in auditors: | 42 | for i in auditors: |
43 | Result.objects.create( | 43 | Result.objects.create( |
44 | auditor_id=i.pk, | 44 | auditor_id=i.pk, |
45 | - project_id=obj_dict['id'] | 45 | + project_id=serializer.data['id'] |
46 | ) | 46 | ) |
47 | url = re.sub("PK", str(obj_dict['id']), FRONT_URL['flow_detail']) | 47 | url = re.sub("PK", str(obj_dict['id']), FRONT_URL['flow_detail']) |
48 | url = re.sub("REDIRECT_URL", parse.quote(url, safe=''), FRONT_URL['wx_authorize']) | 48 | url = re.sub("REDIRECT_URL", parse.quote(url, safe=''), FRONT_URL['wx_authorize']) |
-
请 注册 或 登录 后发表评论