Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/queue/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def enqueue_card_swipe():
swipe_data = body["swipe_data"]
code = body["code"]

if code != db.get_hw_authorization():
if code != db.get_hw_authorization(g.course_id):
return {"message": "Invalid code"}, 403

if decode_pn(swipe_data) == "":
Expand Down
6 changes: 3 additions & 3 deletions api/roster/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# any other decorators such as, auth decorators (min_level, exact_level) must go below it


@blueprint.route("/upload-roster", methods=["POST"])
@blueprint.route("/roster", methods=["POST"])
@min_level("ta")
def upload_roster():
"""
Expand Down Expand Up @@ -87,7 +87,7 @@ def upload_roster():
# TODO: get roster


@blueprint.route("/get-roster", methods=["GET"])
@blueprint.route("/roster", methods=["GET"])
@min_level("ta")
def get_roster():
"""
Expand Down Expand Up @@ -227,7 +227,7 @@ def update_role(user_id):
return {"message": "Updated role."}


@blueprint.route("/clear-enrollments", methods=["DELETE"])
@blueprint.route("/roster", methods=["DELETE"])
@min_level("instructor")
def clear_enrollments():
"""Clear all student enrollments. This soft-deletes their accounts,
Expand Down
2 changes: 0 additions & 2 deletions client/src/components/common/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ function setupHeader() {
showCourse.value = false;
}

console.log(showCourse.value)

fetch("/api/me").then(res => res.json()).then(json => myCourses.value = json["enrollments"])
}

Expand Down
6 changes: 3 additions & 3 deletions client/src/pages/ManageCourse.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ fetch("/api/me").then(res => {

const users = ref<Array<Array<any>>>([]);

const getRoster = () => fetch(`/api/course/${course}/get-roster`).then(res => {
const getRoster = () => fetch(`/api/course/${course}/roster`).then(res => {
if (!res.ok) {
router.push(`/${course}/queue`)
}
Expand Down Expand Up @@ -77,7 +77,7 @@ const setCSVFile = (event: any) => csvFile.value = event.target?.files[0]
function uploadCSV() {
const data = new FormData()
data.append('roster', csvFile.value)
fetch(`/api/course/${course}/upload-roster`, {
fetch(`/api/course/${course}/roster`, {
method: "POST",
body: data
}).then(res => {
Expand Down Expand Up @@ -180,7 +180,7 @@ function deleteUser(user: string) {
const clearDialog = ref<typeof ConfirmationDialog>();

function clearStudents() {
fetch(`/api/course/${course}/clear-enrollments`, { method: "DELETE"} ).then(res => {
fetch(`/api/course/${course}/roster`, { method: "DELETE"} ).then(res => {
if (!res.ok) {
alertBox.value?.setError("Failed to clear roster.")
} else {
Expand Down
Loading