'Checks if a member of a group can leave.'

def user_can_leave(self, userprofile):

    curators = self.curators.all()
    return (getattr(self, 'members_can_leave', True) and ((curators.count() > 1) or (userprofile not in curators)) and (self.has_member(userprofile=userprofile) or self.has_pending_member(userprofile=userprofile)))
