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

Ac 5 #1505

Merged
merged 35 commits into from
Apr 21, 2024
Merged

Ac 5 #1505

Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
07750f7
Fix problem regarding fetching batch for students enrolled in batch 2…
gaur-abhi524 Feb 10, 2023
91e248c
Fix form render for students of 2020 batch and later (#1103)
gaur-abhi524 Feb 13, 2023
3b64aa0
Merge branch 'test-temp' into ac-5
akshatnema Feb 18, 2023
f337d6a
Merge pull request #1151 from FusionIIIT/main
yatharthagoenka Mar 15, 2023
3a117bb
Merge branch 'main' into ac-5
akshatnema Mar 15, 2023
e3b685c
Merge branch 'main' into ac-5
akshatnema Mar 18, 2023
1bfe8f2
Merge branch 'main' into ac-5
akshatnema Mar 19, 2023
d0ba062
Merge branch 'main' into ac-5
akshatnema Mar 23, 2023
4831f8d
Merge branch 'main' into ac-5
akshatnema Mar 26, 2023
bcd84d3
debugging and refactoring
sudheerdagar Feb 20, 2024
037f6bc
resolved invitation notifications error
nityatiwari002 Feb 20, 2024
b19aa2d
Merge pull request #1 from nityatiwari002/main
sudheerdagar Feb 20, 2024
6f24ede
added apply convocation functionality
nityatiwari002 Feb 20, 2024
99c0709
Merge branch 'sudheerdagar:main' into main
nityatiwari002 Feb 20, 2024
3a13ee2
fixed profile redirection issue
sudheerdagar Feb 20, 2024
25000d4
Merge pull request #2 from nityatiwari002/main
sudheerdagar Feb 20, 2024
e6e9d2f
fixed profile redirection issues
sudheerdagar Feb 21, 2024
654496a
Merge branch 'main' of https://github.com/sudheerdagar/Fusion
sudheerdagar Feb 21, 2024
dfdc6b3
refactoring and other changes
sudheerdagar Feb 22, 2024
01ef828
resolved routing error
nityatiwari002 Feb 22, 2024
7eec96a
Merge remote-tracking branch 'upstream/gad-5
sudheerdagar Mar 15, 2024
e1c716a
removed delete button
nityatiwari002 Mar 15, 2024
83d1d94
Merge branch 'main' into main
sudheerdagar Mar 18, 2024
2ad8b76
Merge pull request #3 from nityatiwari002/main
sudheerdagar Mar 18, 2024
4549a6a
Merge branch 'main' of https://github.com/sudheerdagar/Fusion into ac-5
sudheerdagar Mar 18, 2024
ec7e7ee
AC-5 (spacs) : dashboard integration and invitations and applicati…
sudheerdagar Mar 18, 2024
e78b2f6
fixed convocation flag errors updated recent invite Ui
sudheerdagar Apr 19, 2024
eabf67e
fixed previous winners data duplications
sudheerdagar Apr 20, 2024
839f35b
fixed update issues with convocation medals
sudheerdagar Apr 20, 2024
f93a37f
refactoring
sudheerdagar Apr 20, 2024
0ea8a42
Merge branch 'ac-5' into ac-5
sudheerdagar Apr 20, 2024
cbfbfbc
final changes and refactoring
sudheerdagar Apr 20, 2024
85f5d36
modified get_mcm_flags functionalities
sudheerdagar Apr 20, 2024
38d3dce
Merge pull request #1502 from sudheerdagar/ac-5
prabhatsuman Apr 20, 2024
1f12194
Merge branch 'latest_staging' into ac-5
itsspriyansh Apr 20, 2024
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
1 change: 1 addition & 0 deletions FusionIIIT/applications/globals/api/urls.py
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@
url(r'^auth/login/', views.login, name='login-api'),
url(r'^auth/logout/', views.logout, name='logout-api'),
# generic profile endpoint
#code of corresponding view is modifiedtemporary because of mismatched designations
url(r'^profile/(?P<username>.+)/', views.profile, name='profile-api'),
# current user profile
url(r'^profile/', views.profile, name='profile-api'),
6 changes: 5 additions & 1 deletion FusionIIIT/applications/globals/api/views.py
Original file line number Diff line number Diff line change
@@ -117,12 +117,15 @@ def profile(request, username=None):
user = get_object_or_404(User, username=username) if username else request.user
user_detail = serializers.UserSerializer(user).data
profile = serializers.ExtraInfoSerializer(user.extrainfo).data

print(user)

if profile['user_type'] == 'student':
student = user.extrainfo.student
skills = serializers.HasSerializer(student.has_set.all(),many=True).data
education = serializers.EducationSerializer(student.education_set.all(), many=True).data
course = serializers.CourseSerializer(student.course_set.all(), many=True).data
experience = serializers.ExperienceSerializer(student.experience_set.all(), many=True).data
experience = serializers.ExperienceSerializer(student.experience_set.all(), many=True).datap
project = serializers.ProjectSerializer(student.project_set.all(), many=True).data
achievement = serializers.AchievementSerializer(student.achievement_set.all(), many=True).data
publication = serializers.PublicationSerializer(student.publication_set.all(), many=True).data
@@ -143,6 +146,7 @@ def profile(request, username=None):
}
return Response(data=resp, status=status.HTTP_200_OK)
elif profile['user_type'] == 'faculty':
print(username)
return redirect('/eis/api/profile/' + (username+'/' if username else ''))
elif profile['user_type'] == 'staff':
resp = {
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 3.1.5 on 2023-11-16 23:23

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('globals', '0001_initial'),
]

operations = [
migrations.AlterField(
model_name='extrainfo',
name='user_status',
field=models.CharField(choices=[('NEW', 'NEW'), ('PRESENT', 'PRESENT')], default='PRESENT', max_length=50),
),
]
1 change: 1 addition & 0 deletions FusionIIIT/applications/globals/views.py
Original file line number Diff line number Diff line change
@@ -789,6 +789,7 @@ def profile(request, username=None):
"""



user = get_object_or_404(User, Q(username=username)) if username else request.user
editable = request.user == user
print("editable",editable)
2 changes: 1 addition & 1 deletion FusionIIIT/applications/scholarships/urls.py
Original file line number Diff line number Diff line change
@@ -19,4 +19,4 @@
url(r'^updateEndDate/$', views.updateEndDate, name='updateEndDate'),
url(r'^deleteRelease/$', views.deleteRelease, name='deleteRelease'),

]
]
95 changes: 40 additions & 55 deletions FusionIIIT/applications/scholarships/views.py
Original file line number Diff line number Diff line change
@@ -110,36 +110,28 @@ def convener_view(request):
# It updates the student Notification table on the spacs head sending the mcm invitation
if batch == 'All':
active_batches = range(datetime.datetime.now().year - 4 , datetime.datetime.now().year + 1)
# active_batches=str(active_batches)
# active_batches.split(',')
print(active_batches)
querybatch = []
for curbatch in active_batches:
if curbatch > 2019:
curbatch=curbatch%2000
querybatch.append(curbatch)
print( active_batches)
query = reduce(or_, (Q(id__id__startswith=batch) for batch in querybatch))
print(query)

query = reduce(or_, (Q(id__id__startswith=int(batch)-2000) for batch in active_batches))
recipient = Student.objects.filter(programme=programme).filter(query)
else:
if(int(batch)>2019):
curbatch=int(batch)%2000
recipient = Student.objects.filter(programme=programme, id__id__startswith=curbatch)
recipient = Student.objects.filter(programme=programme, id__id__startswith=int(batch)-2000)


# Notification starts
print(recipient)
convenor = request.user
for student in recipient:
scholarship_portal_notif(convenor, student.id.user, 'award_' + award) # Notification
if award == 'Merit-cum-Means Scholarship':
print("MCM")
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_mcm_flag=True,
invite_mcm_accept_flag=False) for student in recipient])
else:
print("convo")
rel = Release.objects.get(date_time=d_time)
Notification.objects.select_related('student_id','release_id').bulk_create([Notification(
release_id=rel,
@@ -169,8 +161,10 @@ def convener_view(request):
year = datetime.datetime.now().year
Mcm.objects.select_related('award_id','student').filter(id=pk).update(status='Accept')
request.session['last_clicked'] = 'Accept_MCM'
Previous_winner.objects.create(
student=student_id, year=year, award_id=award)
zest=Previous_winner.objects.filter(student = student_id, year=year, award_id=award)
print(zest)
if(len(zest)==0):
Previous_winner.objects.create(student=student_id, year=year, award_id=award)
convenor = request.user
recipient = student_id
scholarship_portal_notif(convenor, recipient.id.user, 'Accept_MCM')
@@ -194,8 +188,10 @@ def convener_view(request):
student_id = Director_gold.objects.select_related('student','award_id').get(id=pk).student
year = datetime.datetime.now().year
Director_gold.objects.select_related('student','award_id').filter(id=pk).update(status='Accept')
Previous_winner.objects.create(
student=student_id, year=year, award_id=award)
zest=Previous_winner.objects.filter(student = student_id, year=year, award_id=award)
print(zest)
if(len(zest)==0):
Previous_winner.objects.create(student=student_id, year=year, award_id=award)
convenor = request.user
recipient = student_id
scholarship_portal_notif(
@@ -222,12 +218,13 @@ def convener_view(request):
student_id = Director_silver.objects.select_related('student','award_id').get(id=pk).student
year = datetime.datetime.now().year
Director_silver.objects.select_related('student','award_id').filter(id=pk).update(status='Accept')
Previous_winner.objects.create(
student=student_id, year=year, award_id=award)
zest=Previous_winner.objects.filter(student = student_id, year=year, award_id=award)
print(zest)
if(len(zest)==0):
Previous_winner.objects.create(student=student_id, year=year, award_id=award)
convenor = request.user
recipient = student_id
scholarship_portal_notif(
convenor, recipient.id.user, 'Accept_Silver')
scholarship_portal_notif(convenor, recipient.id.user, 'Accept_Silver')
request.session['last_clicked'] = 'Accept_Silver'
messages.success(request, 'Application is accepted')
return HttpResponseRedirect('/spacs/convener_view')
@@ -238,8 +235,7 @@ def convener_view(request):
Director_silver.objects.select_related('student','award_id').filter(id=pk).update(status='Reject')
convenor = request.user
recipient = student_id
scholarship_portal_notif(
convenor, recipient.id.user, 'Reject_Silver')
scholarship_portal_notif(convenor, recipient.id.user, 'Reject_Silver')
request.session['last_clicked'] = 'Reject_Silver'
messages.success(request, 'Application is rejected')
return HttpResponseRedirect('/spacs/convener_view')
@@ -250,8 +246,10 @@ def convener_view(request):
student_id = Proficiency_dm.objects.select_related('student','award_id').get(id=pk).student
year = datetime.datetime.now().year
Proficiency_dm.objects.select_related('student','award_id').filter(id=pk).update(status='Accept')
Previous_winner.objects.create(
student=student_id, year=year, award_id=award)
zest=Previous_winner.objects.filter(student = student_id, year=year, award_id=award)
print(zest)
if(len(zest)==0):
Previous_winner.objects.create(student=student_id, year=year, award_id=award)
convenor = request.user
recipient = student_id
scholarship_portal_notif(convenor, recipient.id.user, 'Accept_DM')
@@ -454,6 +452,7 @@ def getWinners(request):
return JsonResponse(context)

def get_MCM_Flag(request): # Here we are extracting mcm_flag
print("get mcm_flags here")
x = Notification.objects.select_related('student_id','release_id').filter(student_id=request.user.extrainfo.id)
for i in x:
i.invite_mcm_accept_flag = True
@@ -470,7 +469,9 @@ def get_MCM_Flag(request): # Here we are extracting mcm_flag
# return HttpResponseRedirect('/spacs/student_view')

def getConvocationFlag(request): # Here we are extracting convocation_flag
x = Notification.objects.select_related('student_id', 'release_id').filter(student_id=request.user.extrainfo.id)

print("get convo_flags here")
x = Notification.objects.filter(student_id=request.user.extrainfo.id)
for i in x:
i.invite_convocation_accept_flag = True
i.save()
@@ -1093,55 +1094,39 @@ def sendStudentRenderRequest(request, additionalParams={}):
student_batch = getBatch(request.user.extrainfo.student)
for dates in release:
if checkDate(dates.startdate, dates.enddate):
curBatch = dates.batch
checkBatch = str(request.user.extrainfo.student)[0:4]
batchCondition = False
if checkBatch[2] >= "A" and checkBatch[2] <= "Z":
if(curBatch == 'All'):
batchRange = range(datetime.datetime.now().year - 4, datetime.datetime.now().year + 1)
for batches in batchRange :
if int(checkBatch[0:2]) == batches % 2000:
batchCondition = True
elif curBatch == checkBatch:
batchCondition = True
else:
if(curBatch == 'All'):
batchRange = range(datetime.datetime.now().year - 4, datetime.datetime.now().year + 1)
for batch in batchRange:
if str(checkBatch) == batch:
batchCondition = True
elif curBatch == checkBatch:
True
print("bye")


print(curBatch, checkBatch)
if dates.award == 'Merit-cum-Means Scholarship' and batchCondition and dates.programme == request.user.extrainfo.student.programme:
print("sudheer's test --->")
print(request.user.extrainfo.student)
print(str(request.user.extrainfo.student)[0:2])
if dates.award == 'Merit-cum-Means Scholarship' and dates.batch == "20"+str(request.user.extrainfo.student)[0:2]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 == student_batch and dates.programme == request.user.extrainfo.student.programme:
elif dates.award == 'Convocation Medals' and dates.batch == "20"+str(request.user.extrainfo.student)[0:2]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 == student_batch:


if dates.award == "Merit-cum-Means Scholarship" and dates.batch =="20"+ str(request.user.extrainfo.student)[0:2]:
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 == student_batch:
elif dates.award == 'Convocation Medals' and dates.batch == "20"+str(request.user.extrainfo.student)[0:2]:
try:
x = Notification.objects.select_related('student_id','release_id').get(
student_id=request.user.extrainfo.id, release_id=dates.id).delete()
except:
pass

x = Notification.objects.select_related('student_id','release_id').filter(student_id=request.user.extrainfo.id).order_by('-release_id__date_time')
print(x)
show_mcm_flag = False
show_convocation_flag = False
for i in x:
print(i.invite_convocation_accept_flag)
if i.invite_mcm_accept_flag == True:
show_mcm_flag = True
break
@@ -1187,4 +1172,4 @@ def getCommonParams(request):
context = {'mcm': mcm, 'awards': awards, 'student': student, 'gold': gold, 'silver': silver,
'dandm': dandm, 'con': con, 'assis': assis, 'hd': hd, 'hd1': hd1,
'last_clicked': last_clicked, 'year_range': year_range, 'active_batches': active_batches}
return context
return context
2 changes: 1 addition & 1 deletion FusionIIIT/templates/scholarshipsModule/applyNew.html
Original file line number Diff line number Diff line change
@@ -1129,4 +1129,4 @@
</script>

</body>
{% endblock %}
{% endblock %}
2 changes: 1 addition & 1 deletion FusionIIIT/templates/scholarshipsModule/invite.html
Original file line number Diff line number Diff line change
@@ -304,4 +304,4 @@
}
</script>

{% endblock %}
{% endblock %}