Compare commits
No commits in common. "0ee00d00a935e09315db1731e670277c0ea88ff7" and "0de6962ee7632a5d083a1e1f0751dfe3405c861e" have entirely different histories.
0ee00d00a9
...
0de6962ee7
@ -366,26 +366,12 @@ class NegotiationViewSet(viewsets.ModelViewSet):
|
|||||||
def search_creator_by_status(self, request):
|
def search_creator_by_status(self, request):
|
||||||
"""根据状态搜索达人"""
|
"""根据状态搜索达人"""
|
||||||
status = request.data.get('status')
|
status = request.data.get('status')
|
||||||
allowed_statuses = [
|
|
||||||
'brand_review',
|
|
||||||
'price_negotiation',
|
|
||||||
'contract_review',
|
|
||||||
'draft_ready',
|
|
||||||
'draft_approved',
|
|
||||||
'published'
|
|
||||||
]
|
|
||||||
if not status:
|
if not status:
|
||||||
return Response({
|
return Response({
|
||||||
'code': 400,
|
'code': 400,
|
||||||
'message': '未收到状态',
|
'message': '未收到状态',
|
||||||
'data': None
|
'data': None
|
||||||
})
|
})
|
||||||
if status not in allowed_statuses:
|
|
||||||
return Response({
|
|
||||||
'code': 400,
|
|
||||||
'message': f"status参数不合法, 只能为: {', '.join(allowed_statuses)}",
|
|
||||||
'data': None
|
|
||||||
})
|
|
||||||
|
|
||||||
# 查找符合状态的谈判
|
# 查找符合状态的谈判
|
||||||
negotiations = Negotiation.objects.filter(status=status)
|
negotiations = Negotiation.objects.filter(status=status)
|
||||||
|
Loading…
Reference in New Issue
Block a user