Skip to content

Commit

Permalink
Merge pull request #1687 from grvup/latest_staging
Browse files Browse the repository at this point in the history
Changes for studentacadadmin in aims and academic procedures
  • Loading branch information
ramG-reddy authored Jan 14, 2025
2 parents 3d9bd97 + 7e01c17 commit 012b338
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 13 deletions.
4 changes: 4 additions & 0 deletions FusionIIIT/applications/academic_information/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2136,6 +2136,10 @@ def view_all_student_data(request):
""" views all the students """


if request.session.get('currentDesignationSelected') in ["studentacadadmin"]:
return HttpResponseRedirect('/aims/')


data = []
#students = Student.objects.select_related('batch_id', 'id__user', 'batch_id__discipline', 'id') .filter(batch=2019).order_by('id').all().only('batch', 'id__id', 'id__user', 'programme', 'batch_id__discipline__acronym', 'specialization', 'id__sex', 'category', 'id__phone_no', 'id__date_of_birth', 'id__user__first_name', 'id__user__last_name', 'id__user__email', 'father_name', 'mother_name', 'id__address')[0:20]

Expand Down
23 changes: 11 additions & 12 deletions FusionIIIT/applications/academic_procedures/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def academic_procedures(request):
return HttpResponseRedirect('/academic-procedures/fac/')
# return HttpResponseRedirect('/logout/')

elif request.session.get('currentDesignationSelected') == "acadadmin" :
elif request.session.get('currentDesignationSelected') in ["acadadmin", "studentacadadmin"]:
return HttpResponseRedirect('/aims/')

elif str(request.user) == "rizwan":
Expand Down Expand Up @@ -639,7 +639,7 @@ def academic_procedures_student(request):
elif request.session.get('currentDesignationSelected') == "Associate Professor" :
return HttpResponseRedirect('/academic-procedures/main/')

elif request.session.get('currentDesignationSelected') == "acadadmin" :
elif request.session.get('currentDesignationSelected') in ["acadadmin", "studentacadadmin"]:
return HttpResponseRedirect('/academic-procedures/main/')

else:
Expand Down Expand Up @@ -1032,13 +1032,12 @@ def verify_course(request):
current_user = get_object_or_404(User, username=request.user.username)
user_details = ExtraInfo.objects.all().select_related(
'user', 'department').filter(user=current_user).first()
desig_id = Designation.objects.all().filter(name='acadadmin').first()
temp = HoldsDesignation.objects.all().select_related().filter(
designation=desig_id).first()
desig_id = Designation.objects.all().filter(Q(name='acadadmin') | Q(name='studentacadadmin')).first()
temp = HoldsDesignation.objects.all().select_related().filter(designation=desig_id).first()
acadadmin = temp.working
k = str(user_details).split()
final_user = k[2]
if ('acadadmin' != request.session.get('currentDesignationSelected')):
if (request.session.get('currentDesignationSelected') not in ['acadadmin', 'studentacadadmin']) :
return HttpResponseRedirect('/academic-procedures/')
roll_no = request.POST["rollNo"]
obj = ExtraInfo.objects.all().select_related(
Expand Down Expand Up @@ -1168,7 +1167,7 @@ def acad_branch_change(request):
k = str(user_details).split()
final_user = k[2]

if ('acadadmin' != request.session.get('currentDesignationSelected')):
if ( request.session.get('currentDesignationSelected') not in ['acadadmin', 'studentacadadmin']):
return HttpResponseRedirect('/academic-procedures/')

# year = datetime.datetime.now().year
Expand Down Expand Up @@ -1741,7 +1740,7 @@ def user_check(request):
try:
current_user = get_object_or_404(User, username=request.user.username)
user_details = ExtraInfo.objects.all().select_related('user','department').filter(user=current_user).first()
desig_id = Designation.objects.all().filter(name='acadadmin')
desig_id = Designation.objects.all().filter(Q(name='acadadmin') | Q(name='studentacadadmin'))
temp = HoldsDesignation.objects.all().select_related().filter(designation = desig_id).first()
acadadmin = temp.working
k = str(user_details).split()
Expand All @@ -1751,7 +1750,7 @@ def user_check(request):
final_user=""
pass

if ('acadadmin' != request.session.get('currentDesignationSelected')):
if (request.session.get('currentDesignationSelected') not in ['acadadmin', 'studentacadadmin']):
return True
else:
return False
Expand Down Expand Up @@ -2199,7 +2198,7 @@ def acad_person(request):
elif request.session.get('currentDesignationSelected') == "Associate Professor" :
return HttpResponseRedirect('/academic-procedures/main/')

elif request.session.get('currentDesignationSelected')== "acadadmin" :
elif request.session.get('currentDesignationSelected') in ['acadadmin', 'studentacadadmin']:


# year = datetime.datetime.now().year
Expand Down Expand Up @@ -4032,14 +4031,14 @@ def replaceSwayam(request):
current_user = get_object_or_404(User, username=request.user.username)
user_details = ExtraInfo.objects.all().select_related(
'user', 'department').filter(user=current_user).first()
desig_id = Designation.objects.all().filter(name='acadadmin').first()
desig_id = Designation.objects.all().filter(Q(name='acadadmin') | Q(name='studentacadadmin')).first()
temp = HoldsDesignation.objects.all().select_related().filter(
designation=desig_id).first()
acadadmin = temp.working
k = str(user_details).split()
final_user = k[2]

if ('acadadmin' != request.session.get('currentDesignationSelected')):
if (request.session.get('currentDesignationSelected') not in ['acadadmin', 'studentacadadmin']):
return HttpResponseRedirect('/academic-procedures/')
roll_no = request.POST["rollNo"]
obj = ExtraInfo.objects.all().select_related(
Expand Down
2 changes: 1 addition & 1 deletion FusionIIIT/applications/programme_curriculum/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1653,7 +1653,7 @@ def file_unarchive(request,FileId):

@login_required(login_url='/accounts/login')
def add_course_instructor(request):
if request.session['currentDesignationSelected'] == "acadadmin":
if request.session['currentDesignationSelected'] in ["acadadmin", "studentacadadmin"]:
if request.method == 'POST':
if 'form_submit' in request.POST:
form = CourseInstructorForm(request.POST)
Expand Down

0 comments on commit 012b338

Please sign in to comment.