Skip to content

Commit

Permalink
Merge pull request #1677 from Akashsah2003/latest_staging
Browse files Browse the repository at this point in the history
fix(registration): Fixed bug in final registration and allot courses for acad admin
  • Loading branch information
dvjsharma authored Dec 28, 2024
2 parents f75d298 + 901ca06 commit 6db3791
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions FusionIIIT/applications/academic_procedures/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1655,7 +1655,7 @@ def allot_courses(request):
print(course_code.strip() , course_name.strip())
course = Courses.objects.get(code=course_code.strip(),name=course_name.strip())
if(roll_no not in currroll):
student_check=StudentRegistrationChecks(student_id = student, semester_id = sem_id, pre_registration_flag = True,final_registration_flag = False)
student_check=StudentRegistrationChecks(student_id = student, semester_id = sem_id, pre_registration_flag = True,final_registration_flag = True)
student_checks.append(student_check)
currroll.add(roll_no)
# print(">>>>>",roll_no,course_slot_name,course_code,course_name)
Expand All @@ -1665,7 +1665,7 @@ def allot_courses(request):
course_id=course,semester_id=sem_id,priority=1)
pre_registrations.append(pre_registration)
final_registration=FinalRegistration(student_id=student,course_slot_id=course_slot,
course_id=course,semester_id=sem_id)
course_id=course,semester_id=sem_id, verified=True )
final_registrations.append(final_registration)

courseregistration=course_registration(working_year=datetime.datetime.now().year,course_id=course,semester_id=sem_id,student_id=student,course_slot_id=course_slot)
Expand Down Expand Up @@ -2619,8 +2619,9 @@ def course_list(request):
student_id = request_body['student_id']
semester_id = request_body['semester_id']

final_registration_table = FinalRegistration.objects.all().filter(semester_id = semester_id, verified = False)
final = final_registration_table.filter(student_id = student_id, semester_id = semester_id)
# final_registration_table = FinalRegistration.objects.all().filter(semester_id = semester_id, verified = False)
# final = final_registration_table.filter(student_id = student_id, semester_id = semester_id)
final = FinalRegistration.objects.all().filter(semester_id__semester_no = semester_id, student_id__id=student_id, verified = False)
html = render_to_string('academic_procedures/student_course_list.html',{"course_list":final}, request)

return HttpResponse(json.dumps({'html': html}),content_type="application/json")
Expand Down Expand Up @@ -2717,6 +2718,14 @@ def auto_verify_registration(request):
with transaction.atomic():
for obj in final_register_list:
o = FinalRegistration.objects.filter(id= obj.id).update(verified = True)
course_registration.objects.create(
student_id=obj.student_id,
course_id=obj.course_id,
semester_id=obj.semester_id,
course_slot_id=obj.course_slot_id,
registration_type=obj.registration_type,
working_year=demo_date.year # Set the current year
)
academics_module_notif(request.user, student.id.user, 'registration_approved')

Student.objects.filter(id = student_id).update(curr_semester_no = sem_no)
Expand Down

0 comments on commit 6db3791

Please sign in to comment.