Fix course titles

This commit is contained in:
3eef8a28f26fb2bcc514e6f1938929a1f931762 2023-02-10 00:21:48 -05:00
parent 9ad4dfb0aa
commit ab5d9a15b5

View file

@ -160,7 +160,8 @@ void generate_course_page(const std::string& course_id,
const quatalog_data_t& quatalog_data,
std::ostream& os) {
std::cerr << "Generating course page for " << course_id << "..." << std::endl;
std::string course_name, description;
std::string course_name = get_course_title(course_id,quatalog_data);
std::string description;
const auto& catalog_entry = quatalog_data.catalog[course_id];
const auto& prereqs_entry = get_data(quatalog_data.prerequisites,course_id);
const auto& terms_offered = get_data(quatalog_data.terms_offered,course_id);
@ -169,10 +170,8 @@ void generate_course_page(const std::string& course_id,
const auto& credit_string = generate_credit_string(credits);
if(catalog_entry) {
course_name = catalog_entry["name"].asString();
description = catalog_entry["description"].asString();
} else {
course_name = terms_offered[latest_term]["name"].asString();
description = "This course is not in the most recent catalog. "
"It may have been discontinued, had its course "
"code changed, or just not be in the catalog for "