From faa78f8cf03df21f8f932f41d8a4b155753d2927 Mon Sep 17 00:00:00 2001 From: baoliang Date: Mon, 23 Nov 2020 15:43:53 +0800 Subject: [PATCH] fix task records status bug --- polls/models.py | 5 +++-- polls/views/__pycache__/task.cpython-38.pyc | Bin 3746 -> 3825 bytes polls/views/task.py | 8 ++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/polls/models.py b/polls/models.py index a309939..118bbb5 100644 --- a/polls/models.py +++ b/polls/models.py @@ -4,7 +4,7 @@ import datetime from django.contrib.auth.models import User from django.db import models -from dashboard.models import Group +from dashboard.models import Group, Group_user VERIFY_CODE_TYPE_CHOICES = ( (0, 'register'), @@ -101,7 +101,8 @@ class Task(models.Model): return TaskRecord.objects.filter(task=self).count() def records(self): - return TaskRecord.objects.filter(task=self) + group_ids = [group.id for group in self.groups.all()] + return Group_user.objects.filter(group__in=group_ids) def add_task_message(self, user_id): for group in self.groups.all(): diff --git a/polls/views/__pycache__/task.cpython-38.pyc b/polls/views/__pycache__/task.cpython-38.pyc index b8167686b41dd1f45692129d64c1cd5ec70e3246..0d8d74188974e832dd84e9643087ecd0d516696e 100644 GIT binary patch delta 1473 zcmZ8hON`r86!o(cJ0E-U|4uT~X&FjVHNzCdPh~1V6d@|Ak`5HB5ZpXZ#=(xmwIgWB zC=vq_NK`O#kpLBGh8-*@(kxkZ!LAF|Ua{$jVb?8ec=u)cp^kiX?z`9Te%^Wcv3{qn zt!i3AV2}IWZ=KyOtxj%j9b26^DLq95Dp18vI~hI0dCbl_IX&m(^}JKi3w$kZ7oCz` za>{zyspu6Vn6eqC37Y&=*d&`ouX0yYUZ;_^(8%r!!q&fS z5)IChMKw&EH@x@XFuN|$U7!3wNHNGt$4Dtykq*@>tng4WY#TIWvN0T*0}54UKrQ%K znqzU_OHHyI{4Sj%&7c%nBF)`bBHxl^9%Bj!)!^^w;mRCR+^->qi7uFiZ_>`C%gnnd zFP(adIra&9C3qGipF?;WSH*``!>HvLJ+nc=Xb;@c@F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