From 043fb67b5a4497900e5344dc999c8a3ecad16e69 Mon Sep 17 00:00:00 2001 From: aranzaiger Date: Mon, 3 Aug 2015 00:21:02 +0300 Subject: [PATCH] fix in submitGrade --- SE_API/TaskRoutes.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/SE_API/TaskRoutes.py b/SE_API/TaskRoutes.py index ac59c60..50a6340 100644 --- a/SE_API/TaskRoutes.py +++ b/SE_API/TaskRoutes.py @@ -304,12 +304,14 @@ def submitGrade(token, taskId, ownerId, grade): tg = TaskGrade.all().filter("taskId = ", int(taskId)).filter("userId = ", int(ownerId)) if tg.count() == 0: grade = TaskGrade(taskId=int(taskId), userId=int(ownerId), grade=int(grade)) + db.put(grade) + else: for g in tg.run(): g.grade=int(grade) g.taskId=int(taskId) g.userId=int(ownerId) - db.put(grade) + db.put(g) db.save return Response(response=grade.to_JSON(), status=200,