def is_candidate(self, user):
        return self.candidates.filter(pk=user.pk).exists()
Returns True if user is a candidate.
dataset/ETHPy150Open OpenSlides/OpenSlides/openslides/assignments/models.py/Assignment.is_candidate