def get_unresolved_pending_certs():
    """
    Retrieve a list of unresolved pending certs given a list of ids
    Filters out non-existing pending certs
    """
    query = database.session_query(PendingCertificate).filter(
        PendingCertificate.resolved.is_(False)
    )
    return database.find_all(query, PendingCertificate, {}).all()

    Retrieve a list of unresolved pending certs given a list of ids
    Filters out non-existing pending certs
    
lemur/pending_certificates/service.py