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/roster/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def enroll_user():
if data["role"] not in legal_roles:
return {"message": "Malformed request"}, 400

if get_power_level(data["role"]) >= get_power_level(user["course_role"]):
if get_power_level(data["role"]) > get_power_level(user["course_role"]):
return {"message": "You cannot enroll a user at this level."}, 403

user_id = db.create_account(data["ubit"], data["pn"])
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/common/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const showCourse = ref<boolean>(false)
function fetchCourse() {
fetch(`/api/course/${course.value}`).then(res => {
if (res.ok) {
showCourse.value = true;
return res.json();
}
}).then(json => {
Expand All @@ -27,7 +28,6 @@ function setupHeader() {
course.value = route.params.course
if (course.value !== undefined) {
fetchCourse();
showCourse.value = true;
} else {
showCourse.value = false;
}
Expand Down
11 changes: 10 additions & 1 deletion client/src/components/instructor/VisitTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,16 @@ function exportVisits() {
for (let visit of visits.value) {
let info = ""
for (let i = 0; i < visit.length - 1; i++) {
info += visit[i] != null ? `${visit[i]},` : ','
if (visit[i] != null) {
let data = visit[i];
if (data.indexOf(",") > -1 || data.indexOf("\n") > -1 || data.indexOf("\r") > -1) {
data = `"${data}"`
}
// data = data.replaceAll("\n", " ").replaceAll("\r", " ")
info += data + ","
} else {
info += ","
}
}
info += visit[visit.length-1] != null ? `${visit[visit.length-1]}\n` : '\n'
csv += info
Expand Down
Loading