v0.8.5测试
This commit is contained in:
@@ -109,12 +109,6 @@ class HomeworkService:
|
||||
# 创建扣分记录
|
||||
student = await StudentModel.get_by_id(submission["student_id"])
|
||||
if student:
|
||||
# 检查分数是否会超出范围(防止溢出)
|
||||
current_points = student.get("total_points", 0)
|
||||
new_points = current_points + points_change
|
||||
if new_points < 0:
|
||||
return {"success": False, "message": f"分数不能为负(当前{current_points},扣{abs(points_change)})"}
|
||||
|
||||
# 获取操作人姓名
|
||||
from models.user import UserModel
|
||||
user = await UserModel.get_by_user_id(operator_id)
|
||||
|
||||
Reference in New Issue
Block a user