正在显示
1 个修改的文件
包含
7 行增加
和
7 行删除
@@ -12,7 +12,6 @@ from django.contrib.auth.decorators import login_required | @@ -12,7 +12,6 @@ from django.contrib.auth.decorators import login_required | ||
12 | from django.views.decorators.http import require_http_methods | 12 | from django.views.decorators.http import require_http_methods |
13 | 13 | ||
14 | from .serializers import ProjectSerializer | 14 | from .serializers import ProjectSerializer |
15 | -from usercenter.models import User | ||
16 | from .models import Auditor, Project, Result | 15 | from .models import Auditor, Project, Result |
17 | from utils.helpers import WxPushHelper | 16 | from utils.helpers import WxPushHelper |
18 | from utils.pagination import MyPageNumberPagination | 17 | from utils.pagination import MyPageNumberPagination |
@@ -20,8 +19,8 @@ from utils.util import response | @@ -20,8 +19,8 @@ from utils.util import response | ||
20 | from wxProject.settings import FRONT_URL | 19 | from wxProject.settings import FRONT_URL |
21 | 20 | ||
22 | AUDITORS = ( | 21 | AUDITORS = ( |
23 | - (2, '邓望明'), | ||
24 | - (3, '杜波') | 22 | + (1, '邓望明'), |
23 | + (2, '杜波') | ||
25 | ) | 24 | ) |
26 | 25 | ||
27 | 26 | ||
@@ -41,8 +40,9 @@ class CreateProject(CreateAPIView): | @@ -41,8 +40,9 @@ class CreateProject(CreateAPIView): | ||
41 | obj_dict = serializer.data | 40 | obj_dict = serializer.data |
42 | url = re.sub("PK", str(obj_dict['id']), FRONT_URL['flow_detail']) | 41 | url = re.sub("PK", str(obj_dict['id']), FRONT_URL['flow_detail']) |
43 | url = re.sub("REDIRECT_URL", parse.quote(url, safe=''), FRONT_URL['wx_authorize']) | 42 | url = re.sub("REDIRECT_URL", parse.quote(url, safe=''), FRONT_URL['wx_authorize']) |
44 | - first_auditor = User.objects.filter(pk=AUDITORS[0][0]).first() | ||
45 | - wx_client.push_card(first_auditor.wx_token, url, f"{request.user.username}提交了一个产品立项申请") | 43 | + first_auditor = Auditor.objects.filter(pk=AUDITORS[0][0]).first() |
44 | + | ||
45 | + wx_client.push_card(first_auditor.user.wx_token, url, f"{request.user.username}提交了一个产品立项申请") | ||
46 | wx_client.push_card(request.user.wx_token, url, u"流程创建成功") | 46 | wx_client.push_card(request.user.wx_token, url, u"流程创建成功") |
47 | return response(obj_dict) | 47 | return response(obj_dict) |
48 | 48 | ||
@@ -108,8 +108,8 @@ class AuditProject(UpdateAPIView): | @@ -108,8 +108,8 @@ class AuditProject(UpdateAPIView): | ||
108 | obj.is_done = True | 108 | obj.is_done = True |
109 | obj.is_pass = False | 109 | obj.is_pass = False |
110 | else: | 110 | else: |
111 | - second_auditor = User.objects.filter(pk=AUDITORS[1][0]).first() | ||
112 | - wx_client.push_card(second_auditor.wx_token, url, f"{request.user.username}提交了一个产品立项申请") | 111 | + second_auditor = Auditor.objects.filter(pk=AUDITORS[1][0]).first() |
112 | + wx_client.push_card(second_auditor.user.wx_token, url, f"{request.user.username}提交了一个产品立项申请") | ||
113 | obj.save() | 113 | obj.save() |
114 | wx_client.push_card(obj.creator.wx_token, url, desc) | 114 | wx_client.push_card(obj.creator.wx_token, url, desc) |
115 | 115 |
-
请 注册 或 登录 后发表评论