def _check_release_done_processing(release):
    if release.status != models.Release.PROCESSING:
        logging.info('Release not in processing state yet: build_id=%r, '
                     'name=%r, number=%d', release.build_id, release.name,
                     release.number)
        return False
    query = models.Run.query.filter_by(release_id=release.id)
    for run in query:
        if run.status == models.Run.NEEDS_DIFF:
            return False
        if run.ref_config and not run.ref_image:
            return False
        if run.config and not run.image:
            return False
    logging.info('Release done processing, now reviewing: build_id=%r, '
                 'name=%r, number=%d', release.build_id, release.name,
                 release.number)
    build_id = release.build_id
    release_name = release.name
    release_number = release.number
    @utils.after_this_request
    def send_notification_email(response):
        emails.send_ready_for_review(build_id, release_name, release_number)
    release.status = models.Release.REVIEWING
    db.session.add(release)
    return True