add message
This commit is contained in:
parent
8c642afa2c
commit
27d5548f6f
Binary file not shown.
Binary file not shown.
|
@ -40,13 +40,16 @@ def create_task(request):
|
|||
user = request.user
|
||||
creater_profile = user.userprofile_set.first()
|
||||
content = request.POST.get('content')
|
||||
url = request.POST.get('url')
|
||||
if not content:
|
||||
return JsonResponse({'status': 'error', 'message': '内容不能为空'})
|
||||
if not content:
|
||||
return JsonResponse({'status': 'error', 'message': 'URL地址不能为空'})
|
||||
groups = request.POST.getlist('groups', [])
|
||||
print(groups)
|
||||
task = Task.objects.create(created_by=user, content=content)
|
||||
task.add_groups(groups)
|
||||
task.add_task_message(user.id)
|
||||
url = request.POST.get('url')
|
||||
# print(groups, content, url)
|
||||
file = request.FILES.get('file')
|
||||
picture = request.FILES.get('picture')
|
||||
|
|
Loading…
Reference in New Issue