From 669346ddba4d595ca613a10c5a82bd87e700d832 Mon Sep 17 00:00:00 2001 From: Abhyuday Singh Date: Mon, 30 Dec 2024 22:52:54 +0530 Subject: [PATCH] changes to upload previous sem grades data --- FusionIIIT/applications/examination/views.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/FusionIIIT/applications/examination/views.py b/FusionIIIT/applications/examination/views.py index fcafdffa1..e917836a5 100644 --- a/FusionIIIT/applications/examination/views.py +++ b/FusionIIIT/applications/examination/views.py @@ -987,8 +987,9 @@ def upload_grades(request): roll_no = row["roll_no"] grade = row["grade"] remarks = row["remarks"] - stud=Student.objects.get(id_id=roll_no) - semester=stud.curr_semester_no + semester = row["semester"] if "semester" in row and row["semester"] else None + stud = Student.objects.get(id_id=roll_no) + semester = semester or stud.curr_semester_no batch=stud.batch Student_grades.objects.create( @@ -1274,10 +1275,12 @@ def upload_grades_prof(request): roll_no = row["roll_no"] grade = row["grade"] remarks = row["remarks"] - stud=Student.objects.get(id_id=roll_no) - semester=stud.curr_semester_no + semester = row["semester"] if "semester" in row and row["semester"] else None + stud = Student.objects.get(id_id=roll_no) + semester = semester or stud.curr_semester_no batch=stud.batch reSubmit=False + Student_grades.objects.update_or_create( roll_no=roll_no, course_id_id=course_id,