Skip to content
Merged
Show file tree
Hide file tree
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
14 changes: 14 additions & 0 deletions FusionIIIT/applications/scholarships/helpers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import subprocess
from datetime import datetime

from django.conf import settings


def getBatch(roll):
batch = "20"
if(str(roll)[2].isdigit()):
return str(roll)[0:4]

else:
batch+=str(roll)[0:2]
return batch
10 changes: 6 additions & 4 deletions FusionIIIT/applications/scholarships/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from .validations import MCM_list, MCM_schema, gold_list, gold_schema, silver_list, silver_schema, proficiency_list,proficiency_schema
from jsonschema import validate
from jsonschema.exceptions import ValidationError
from .helpers import getBatch
# Create your views here.


Expand Down Expand Up @@ -1039,24 +1040,25 @@ def sendStudentRenderRequest(request, additionalParams={}):
update_con_flag = False
x_notif_mcm_flag = False
x_notif_con_flag = False
student_batch = getBatch(request.user.extrainfo.student)
for dates in release:
if checkDate(dates.startdate, dates.enddate):
if dates.award == 'Merit-cum-Means Scholarship' and dates.batch == str(request.user.extrainfo.student)[0:4] and dates.programme == request.user.extrainfo.student.programme:
if dates.award == 'Merit-cum-Means Scholarship' and dates.batch == student_batch and dates.programme == request.user.extrainfo.student.programme:
x_notif_mcm_flag = True
if no_of_mcm_filled > 0:
update_mcm_flag = True
elif dates.award == 'Convocation Medals' and dates.batch == str(request.user.extrainfo.student)[0:4] and dates.programme == request.user.extrainfo.student.programme:
elif dates.award == 'Convocation Medals' and dates.batch == student_batch and dates.programme == request.user.extrainfo.student.programme:
x_notif_con_flag = True
if no_of_con_filled > 0:
update_con_flag = True
else:
if dates.award == "Merit-cum-Means Scholarship" and dates.batch == str(request.user.extrainfo.student)[0:4]:
if dates.award == "Merit-cum-Means Scholarship" and dates.batch == student_batch:
try:
x = Notification.objects.select_related('student_id','release_id').get(
student_id=request.user.extrainfo.id, release_id=dates.id).delete()
except:
pass
elif dates.award == 'Convocation Medals' and dates.batch == str(request.user.extrainfo.student)[0:4]:
elif dates.award == 'Convocation Medals' and dates.batch == student_batch:
try:
x = Notification.objects.select_related('student_id','release_id').get(
student_id=request.user.extrainfo.id, release_id=dates.id).delete()
Expand Down