Skip to content
Open
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
26 changes: 16 additions & 10 deletions FusionIIIT/applications/scholarships/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def convener_view(request):
if request.method == 'POST':
print("this is a check for post request")
if 'Submit' in request.POST:
print("this is a check for post xfhjgisdfkhlsjk request")
# print("this is a check for post xfhjgisdfkhlsjk request")
award = request.POST.get('type')
print("award " + award)
programme = request.POST.get('programme')
Expand All @@ -95,6 +95,7 @@ def convener_view(request):
remarks = request.POST.get('remarks')
request.session['last_clicked'] = 'Submit'
d_time = datetime.datetime.now()
# print("batch 1 " + str(batch))
Release.objects.create(
date_time=d_time,
programme=programme,
Expand All @@ -111,19 +112,22 @@ def convener_view(request):
active_batches = range(datetime.datetime.now().year - 4 , datetime.datetime.now().year + 1)
# active_batches=str(active_batches)
# active_batches.split(',')
print(active_batches)
# print(active_batches)
querybatch = []
for curbatch in active_batches:
if curbatch > 2019:
curbatch=curbatch%2000
querybatch.append(curbatch)
print( active_batches)
# print( active_batches)
query = reduce(or_, (Q(id__id__startswith=batch) for batch in querybatch))
print(query)
# print("query "+ query)
recipient = Student.objects.filter(programme=programme).filter(query)
else:
curbatch = int(batch)
if(int(batch)>2019):
curbatch=int(batch)%2000
# print("batch " + str(batch))
# print("curbatch " + str(curbatch))
recipient = Student.objects.filter(programme=programme, id__id__startswith=curbatch)

# Notification starts
Expand All @@ -137,14 +141,14 @@ def convener_view(request):
release_id=rel,
student_id=student,
notification_mcm_flag=True,
invite_mcm_accept_flag=False) for student in recipient])
invite_mcm_accept_flag=True) for student in recipient])
else:
rel = Release.objects.get(date_time=d_time)
Notification.objects.select_related('student_id','release_id').bulk_create([Notification(
release_id=rel,
student_id=student,
notification_convocation_flag=True,
invite_convocation_accept_flag=False) for student in recipient])
invite_convocation_accept_flag=True) for student in recipient])
# Notification ends
print(batch)
messages.success(request,
Expand Down Expand Up @@ -752,7 +756,7 @@ def submitGold(request):
for release in releases:
existingRelease = Director_gold.objects.select_related('student','award_id').filter(Q(date__gte=release.startdate, date__lte=release.enddate)).filter(student=request.user.extrainfo.student)
if existingRelease:
existingRelease.update(
Director_gold.objects.select_related('student', 'award_id').filter(Q(date__gte=release.startdate, date__lte=release.enddate)).filter(student=request.user.extrainfo.student).update(
student=student_id,
relevant_document=relevant_document,
award_id=award_id,
Expand Down Expand Up @@ -1070,7 +1074,7 @@ def sendConvenerRenderRequest(request, additionalParams={}):

def sendStudentRenderRequest(request, additionalParams={}):
context = getCommonParams(request)

print("check send student enter")
ch = Constants.BATCH
time = Constants.TIME
mother_occ = Constants.MOTHER_OCC_CHOICES
Expand All @@ -1095,6 +1099,8 @@ def sendStudentRenderRequest(request, additionalParams={}):
curBatch = dates.batch
checkBatch = str(request.user.extrainfo.student)[0:4]
batchCondition = False
print("checkbatch", checkBatch)
print("curBatch", curBatch)
if checkBatch[2] >= "A" and checkBatch[2] <= "Z":
if(curBatch == 'All'):
batchRange = range(datetime.datetime.now().year - 4, datetime.datetime.now().year + 1)
Expand All @@ -1111,10 +1117,10 @@ def sendStudentRenderRequest(request, additionalParams={}):
batchCondition = True
elif curBatch == checkBatch:
True
print("bye")
# print("bye")


print(curBatch, checkBatch)
# print(curBatch, checkBatch) /
if dates.award == 'Merit-cum-Means Scholarship' and batchCondition and dates.programme == request.user.extrainfo.student.programme:
x_notif_mcm_flag = True
if no_of_mcm_filled > 0:
Expand Down
7 changes: 2 additions & 5 deletions FusionIIIT/templates/scholarshipsModule/invite.html
Original file line number Diff line number Diff line change
Expand Up @@ -229,11 +229,8 @@
</div>
</div>
<div class="ui modal1">
<div class="header">Delete Of Application </div>
<div class="content">
<button type='date' name = 'updated_enddate' id= "enddate_up" required>
<input type="hidden" name="delete_release_id" id= "delete_release_id" value="">
</div>


<div class="actions">
<div class="ui approve button" id = "update_enddate_modal_btn">Update</div>
<div class="ui cancel button">Cancel</div>
Expand Down