diff --git a/FusionIIIT/applications/scholarships/views.py b/FusionIIIT/applications/scholarships/views.py index ef91287d0..47038aeb5 100755 --- a/FusionIIIT/applications/scholarships/views.py +++ b/FusionIIIT/applications/scholarships/views.py @@ -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') @@ -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, @@ -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 @@ -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, @@ -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, @@ -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 @@ -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) @@ -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: diff --git a/FusionIIIT/templates/scholarshipsModule/invite.html b/FusionIIIT/templates/scholarshipsModule/invite.html index a928c3f29..0209ca62b 100755 --- a/FusionIIIT/templates/scholarshipsModule/invite.html +++ b/FusionIIIT/templates/scholarshipsModule/invite.html @@ -229,11 +229,8 @@