def can_candidate_access(application, email):
    """
    Can candidate access Application

    Match on the authorized email field on Application model. Do not match on
    the candidate email field on the Questionnaire model.

    Parameters
    ----------
    application : Application
        Application that is potentially being accessed
    email : str
        Candidate email address (authorized_email)

    Returns
        -------
        bool
            Returns true for access granted
    """

    authorized_email = application.authorized_email
    if authorized_email is not None and (
        authorized_email.lower() == email.lower()
    ):
        can_access = True
    else:
        can_access = False

    return can_access