def is_doctor(user):
    """
    Helper function that checks if a user is a doctor
    :param user: The user to be checked
    :return: True if user is a doctor
    """
    if user:
        return user.groups.filter(name='Doctor').count() != 0
    return False