Skip to content
Snippets Groups Projects
Commit a57e721c authored by Odin Johan Vatne's avatar Odin Johan Vatne
Browse files

Hide group projects from student priority dropdown

parent d690fd2f
Branches
No related tags found
No related merge requests found
...@@ -400,16 +400,17 @@ def student_applications_view(request): ...@@ -400,16 +400,17 @@ def student_applications_view(request):
''' '''
my_applications = Application.objects.filter(student=request.user) my_applications = Application.objects.filter(student=request.user)
group_applications = request.user.member_projects.all() group_applications = request.user.member_projects.all()
applications = (my_applications | group_applications).distinct() all_applications = (my_applications | group_applications).distinct()
closed_applications = applications.filter(app_closed_query) closed_applications = all_applications.filter(app_closed_query)
applications = applications.exclude(app_closed_query) all_applications = all_applications.exclude(app_closed_query)
selectable_applications = my_applications.exclude(app_closed_query)
offered_applications = applications.filter(professor_status=Application.ProfessorStatus.OFFERED) offered_applications = all_applications.filter(professor_status=Application.ProfessorStatus.OFFERED)
open_applications = applications.filter(professor_status=Application.ProfessorStatus.NONE) open_applications = all_applications.filter(professor_status=Application.ProfessorStatus.NONE)
comments = Comment.objects.filter(application__in=applications) comments = Comment.objects.filter(application__in=all_applications)
context = {'applications': applications, 'offeredApplications': offered_applications, context = {'applications': selectable_applications, 'offeredApplications': offered_applications,
'openApplications': open_applications, 'closedApplications': closed_applications, 'openApplications': open_applications, 'closedApplications': closed_applications,
'comments': comments} 'comments': comments}
return render(request, 'pasapp/pages/student_applications.html', contextWithHeader(context, request)) return render(request, 'pasapp/pages/student_applications.html', contextWithHeader(context, request))
...@@ -533,7 +534,6 @@ def update_professor_status(request): ...@@ -533,7 +534,6 @@ def update_professor_status(request):
if application.professor_status == Application.ProfessorStatus.OFFERED: if application.professor_status == Application.ProfessorStatus.OFFERED:
return HttpResponseBadRequest("This offer has already been extended.") return HttpResponseBadRequest("This offer has already been extended.")
print(action)
if action == 'offer': if action == 'offer':
application.professor_status = Application.ProfessorStatus.OFFERED application.professor_status = Application.ProfessorStatus.OFFERED
if application.student_status == 'PRE': if application.student_status == 'PRE':
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment