add message

This commit is contained in:
baoliang 2020-12-05 16:14:34 +08:00
parent b244443dc1
commit 475b634a4b
1 changed files with 4 additions and 2 deletions

View File

@ -68,6 +68,8 @@ def create_task(request):
users = Group_user.objects.filter(group=group)
for u in users:
g = Group.objects.get(id=group)
profile = Userprofile.objects.filter(user_id=u.user_id).first()
if profile and profile.status == 1:
content = '%s在群组“%s”发布了任务,请查收消息' % (profile, g.name)
Notice.create_normal_notice(u.user_id, content, group)
return JsonResponse({'status': 'success'})