Example #1
0
def _update_qc_reviewers(entries):
    """
    Support function for update_checklist(). Updates QC info on the dashboard.
    """
    try:
        user = dashboard.get_default_user()
    except:
        raise MetadataException(
            "Can't update dashboard QC information without "
            "a default dashboard user defined. Please add "
            "'DEFAULT_DASH_USER' to your config file.")

    for subject in entries:
        timepoint = dashboard.get_subject(subject)
        if not timepoint or not timepoint.sessions:
            raise MetadataException("{} not found in the in the dashboard "
                                    "database.".format(subject))

        comment = entries[subject]
        if not comment:
            # User was just registering a new QC entry. As long as the
            # session exists in the database there is no work to do.
            continue

        for num in timepoint.sessions:
            session = timepoint.sessions[num]
            if session.is_qcd():
                # Dont risk writing over QC-ers from the dashboard.
                continue
            session.sign_off(user.id)
Example #2
0
def _update_scan_checklist(entries):
    """
    Helper function for 'update_blacklist()'. Updates the dashboard's database.
    """
    try:
        user = dashboard.get_default_user()
    except:
        raise MetadataException(
            "Can't update dashboard QC information without "
            "a default dashboard user defined. Please add "
            "'DEFAULT_DASH_USER' to your config file.")

    for scan_name in entries:
        scan = dashboard.get_scan(scan_name)
        if not scan:
            raise MetadataException("{} does not exist in the dashboard "
                                    "database".format(scan_name))
        scan.add_checklist_entry(user.id,
                                 comment=entries[scan_name],
                                 sign_off=False)