Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

working_year column insertions #1521

Merged
merged 1 commit into from
Apr 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading