feat: restrict user answer compaction to admin users and update related tests

This commit is contained in:
Ross
2026-07-06 09:43:01 +01:00
parent daebdc1844
commit e56c1f2d0f
7 changed files with 53 additions and 45 deletions
+2 -3
View File
@@ -240,12 +240,11 @@ def test_exams(db, client):
res = client.post(reverse("global_exam_answers_submit"), data=post_json)
json_res = json.loads(res.content)
assert json_res["success"] == False
assert json_res["error"] == "Invalid data"
assert json_res["error"] in ("Invalid data", "user / cid mismatch")
valid_answers = []
for questions in exam_json["questions"]:
for qid in questions:
for qid in exam_json["questions"]:
post_data = {
"eid": exam_json["eid"],
"cid": post_cid,