Skip to content
Snippets Groups Projects

Let active and managed courses only return not-deleted courses

1 file
+ 3
3
Compare changes
  • Side-by-side
  • Inline
@@ -56,13 +56,13 @@ public class CourseEditionRepository {
*/
protected static final String GET_MANAGED = "SELECT * FROM (SELECT ce_id FROM (SELECT ce_id, netid FROM Manages"
+ " UNION SELECT id, owner FROM CourseEdition) AS U WHERE U.netid = ?) AS MC JOIN CourseEdition"
+ " ON ce_id = id";
+ " ON ce_id = id WHERE deleted = false";
/**
* The {@link String} instance to get all active courses.
*/
protected static final String GET_ACTIVE = "SELECT C.* FROM CourseEdition AS C JOIN Quarter AS Q"
+ " ON C.year = Q.year AND C.quarter = Q.quarter WHERE interest = 1";
+ " ON C.year = Q.year AND C.quarter = Q.quarter WHERE interest = 1 AND deleted = false";
/**
* The {@link String} instance to get the assigned users to the course.
@@ -76,7 +76,7 @@ public class CourseEditionRepository {
* The {@link String} instance to check whether a course with a specific id is active.
*/
protected static final String CHECK_ACTIVE = "SELECT C.* FROM CourseEdition AS C JOIN Quarter AS Q"
+ " ON C.year = Q.year AND C.quarter = Q.quarter WHERE interest = 1 AND C.id = ?";
+ " ON C.year = Q.year AND C.quarter = Q.quarter WHERE interest = 1 AND C.id = ? AND deleted = false";
/**
* Retrieve the course information of the course with the given course id.
Loading