From 0313fd9751703be8f67bd8e55a2fe5f007488f44 Mon Sep 17 00:00:00 2001 From: Nathan Leniz Date: Fri, 6 Feb 2015 14:28:28 -0500 Subject: [PATCH] Fixed routing for unfound coursewares --- controllers/courseware.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/controllers/courseware.js b/controllers/courseware.js index cac15ab86f..716e7d00d2 100644 --- a/controllers/courseware.js +++ b/controllers/courseware.js @@ -57,8 +57,6 @@ exports.returnIndividualCourseware = function(req, res, next) { if (err) { next(err); } - courseware = courseware.pop(); - // Handle not found if (courseware.length < 1) { req.flash('errors', { @@ -66,6 +64,7 @@ exports.returnIndividualCourseware = function(req, res, next) { }); return res.redirect('/coursewares') } + courseware = courseware.pop(); // Redirect to full name if the user only entered a partial var dashedNameFull = courseware.name.toLowerCase().replace(/\s/g, '-');