Skip to content

Commit

Permalink
working_year column insertions
Browse files Browse the repository at this point in the history
  • Loading branch information
Divyanshu-iiitdmj committed Apr 22, 2024
1 parent 039df0f commit 181b94e
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions FusionIIIT/applications/academic_procedures/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
from django.db.models.functions import Concat,ExtractYear,ExtractMonth,ExtractDay,Cast
from .api import serializers
from django.core.serializers import serialize

import datetime

"""every newfuncitons that have been created with name auto_ in start of their original name is to implement new logic of registraion ..
unlike the previous registration logic that was done with priority """
Expand Down Expand Up @@ -1050,7 +1050,7 @@ def acad_add_course(request):
sem_id = request.POST['semester_id']
semester = Semester.objects.get(id=sem_id)
cr = course_registration(
course_id=course, student_id=student, semester_id=semester)
course_id=course, student_id=student, semester_id=semester , working_year = datetime.datetime.now().year,)
cr.save()

return HttpResponseRedirect('/academic-procedures/')
Expand Down Expand Up @@ -1718,7 +1718,8 @@ def add_courses(request):
course_id = course_id,
student_id=current_user,
course_slot_id = courseslot_id,
semester_id=sem_id
semester_id=sem_id,
working_year = datetime.datetime.now().year,
)
if p not in reg_curr:
reg_curr.append(p)
Expand Down Expand Up @@ -1924,6 +1925,7 @@ def get_add_course_options(branch_courses, current_register, batch):
if courseslot not in slots:
lis = []
for course in courseslot.courses.all():
print(course)
if course_registration.objects.filter(student_id__batch_id__year = batch, course_id = course).count() < max_limit:
lis.append(course)
course_option.append((courseslot, lis))
Expand Down Expand Up @@ -2560,7 +2562,8 @@ def verify_registration(request):
course_id=obj.course_id,
student_id=student,
semester_id=obj.semester_id,
course_slot_id = obj.course_slot_id
course_slot_id = obj.course_slot_id,
working_year = datetime.datetime.now().year,
)
ver_reg.append(p)
o = FinalRegistration.objects.filter(id= obj.id).update(verified = True)
Expand Down Expand Up @@ -3836,7 +3839,8 @@ def add_one_course(request):
course_id=course_id,
student_id=current_user,
course_slot_id=courseslot_id,
semester_id=sem_id
semester_id=sem_id,
working_year = datetime.datetime.now().year,
)
p.save()
return JsonResponse({'message': 'Course added successfully'})
Expand Down Expand Up @@ -4041,7 +4045,7 @@ def swayam_replace(request):
semester_id = semester_id_model,
student_id = student_id_model,
course_slot_id = course_slot_id_model,
working_year = 1
working_year = datetime.datetime.now().year,
)
obj.save()

Expand Down Expand Up @@ -4086,7 +4090,8 @@ def register_backlog_course(request):
course_id=course_id,
student_id=current_user,
course_slot_id=course_slot_id,
semester_id=sem_id
semester_id=sem_id,
working_year = datetime.datetime.now().year,
)
p.save()
return JsonResponse({'message': 'Successfully Registered Backlog course' }, status=200)
Expand Down

0 comments on commit 181b94e

Please sign in to comment.