feat: add simple name match rule
This commit is contained in:
@@ -101,8 +101,13 @@ def upload_score():
|
||||
):
|
||||
if not re.fullmatch(r"^\d{12}$", data["id"]):
|
||||
return jsonify({"message": "学号不合规,不记录成绩!"}), 400
|
||||
elif data["name"] == "test_name" or data["name"] == "":
|
||||
return jsonify({"message": "请完善姓名,默认名字不记录成绩!"}), 400
|
||||
elif (
|
||||
data["name"] == "test_name"
|
||||
or data["name"].startswith("test")
|
||||
or data["name"] == "name"
|
||||
or data["name"] == ""
|
||||
):
|
||||
return jsonify({"message": "姓名不合规,不记录成绩!"}), 400
|
||||
data["details"] = data["details"].replace("\n", "<br>")
|
||||
write_to_csv(data, data["project"])
|
||||
return jsonify({"message": "上传成绩成功!"}), 200
|
||||
|
||||
Reference in New Issue
Block a user