def handle(self, **options):
assignment_count = Assignment.objects.count()
for participant in Participant.objects.all():
- if participant.answer_set.count() == assignment_count:
+ answers = participant.answer_set.all()
+ if len(answers) == assignment_count and all(answer.is_complete() for answer in answers):
participant.complete_set = True
participant.save()