Пример #1
0
def submit_collection(assignment_import):
    (assignment_import, assignment) = _get_collection(assignment_import)
    client = AdSel()
    client.get_quarters()
    if isinstance(assignment_import, SyskeyImport):
        if assignment_import.cohort:
            if assignment_import.upload_filename is not None:
                return client.assign_cohorts_bulk(assignment)
            else:
                return client.assign_cohorts_manual(assignment)
        elif assignment_import.major and len(assignment_import.major) > 0:
            return client.assign_majors(assignment)
    else:
        return client.assign_purple_gold(assignment)
Пример #2
0
def reset_purplegold(import_args, apps):
    assignment = PurpleGoldAssignment()
    assignment.assignment_type = "file"
    assignment.quarter = import_args['quarter']
    assignment.campus = import_args['campus']
    assignment.user = import_args['created_by']
    assignment.comments = import_args['comment']

    applicants_to_assign = []
    for app in apps:
        applicants_to_assign.append(
            PurpleGoldApplication(adsel_id=app.adsel_id, award_amount=0))
    assignment.applicants = applicants_to_assign

    client = AdSel()
    return client.assign_purple_gold(assignment)