def pst_form_view(request): mandate_id = request.POST.get("mandate_id") mandate = assistant_mandate.find_mandate_by_id(mandate_id) current_reviewer = reviewer.Reviewer.objects.filter( person=request.user.person, entity__mandateentity__assistant_mandate=mandate ).first() current_role = current_reviewer.role entity = entity_version.get_last_version(current_reviewer.entity) entities = get_entities_for_mandate(mandate) learning_units = tutoring_learning_unit_year.find_by_mandate(mandate) phd_files = assistant_document_file.find_by_assistant_mandate_and_description(mandate, document_type.PHD_DOCUMENT) research_files = assistant_document_file.find_by_assistant_mandate_and_description(mandate, document_type.RESEARCH_DOCUMENT) tutoring_files = assistant_document_file.find_by_assistant_mandate_and_description(mandate, document_type.TUTORING_DOCUMENT) assistant = mandate.assistant menu = generate_reviewer_menu_tabs(current_role, mandate, None) return render(request, 'pst_form_view.html', {'menu': menu, 'menu_type': 'reviewer_menu', 'mandate_id': mandate.id, 'assistant': assistant, 'mandate': mandate, 'learning_units': learning_units, 'entity': entity, 'entities': entities, 'phd_files': phd_files, 'assistant_mandate_renewal': assistant_mandate_renewal, 'research_files': research_files, 'tutoring_files': tutoring_files, 'current_reviewer': current_reviewer, 'role': current_role, 'year': mandate.academic_year.year + 1})
def pst_form_view(request): mandate_id = request.POST.get("mandate_id") mandate = assistant_mandate.find_mandate_by_id(mandate_id) current_role = reviewer_role.PHD_SUPERVISOR current_person = request.user.person learning_units = tutoring_learning_unit_year.find_by_mandate(mandate) assistant = mandate.assistant entities = get_entities_for_mandate(mandate) phd_files = assistant_document_file.find_by_assistant_mandate_and_description( mandate, document_type.PHD_DOCUMENT) research_files = assistant_document_file.find_by_assistant_mandate_and_description( mandate, document_type.RESEARCH_DOCUMENT) tutoring_files = assistant_document_file.find_by_assistant_mandate_and_description( mandate, document_type.TUTORING_DOCUMENT) menu = generate_phd_supervisor_menu_tabs(mandate, None) return render( request, 'pst_form_view.html', { 'menu': menu, 'mandate_id': mandate.id, 'assistant': assistant, 'mandate': mandate, 'learning_units': learning_units, 'current_person': current_person, 'phd_files': phd_files, 'entities': entities, 'research_files': research_files, 'tutoring_files': tutoring_files, 'role': current_role, 'assistant_mandate_renewal': assistant_mandate_renewal, 'menu_type': 'phd_supervisor_menu', 'year': mandate.academic_year.year + 1 })
def pst_form_view(request): mandate_id = request.POST.get("mandate_id") mandate = assistant_mandate.find_mandate_by_id(mandate_id) current_reviewer = reviewer.find_by_person(request.user.person) current_role = current_reviewer.role entity = entity_version.get_last_version(current_reviewer.entity) entities = get_entities_for_mandate(mandate) learning_units = tutoring_learning_unit_year.find_by_mandate(mandate) phd_files = assistant_document_file.find_by_assistant_mandate_and_description(mandate, document_type.PHD_DOCUMENT) research_files = assistant_document_file.find_by_assistant_mandate_and_description(mandate, document_type.RESEARCH_DOCUMENT) tutoring_files = assistant_document_file.find_by_assistant_mandate_and_description(mandate, document_type.TUTORING_DOCUMENT) assistant = mandate.assistant menu = generate_reviewer_menu_tabs(current_role, mandate, None) return render(request, 'pst_form_view.html', {'menu': menu, 'menu_type': 'reviewer_menu', 'mandate_id': mandate.id, 'assistant': assistant, 'mandate': mandate, 'learning_units': learning_units, 'entity': entity, 'entities': entities, 'phd_files': phd_files, 'assistant_mandate_renewal': assistant_mandate_renewal, 'research_files': research_files, 'tutoring_files': tutoring_files, 'current_reviewer': current_reviewer, 'role': current_role, 'year': mandate.academic_year.year + 1})
def get_context_data(self, **kwargs): context = super(AssistantLearningUnitsListView, self).get_context_data(**kwargs) mandate = assistant_mandate.find_mandate_by_assistant_for_academic_year( academic_assistant.find_by_person(self.request.user.person), academic_year.current_academic_year()) context['mandate_id'] = mandate.id context['assistant_type'] = mandate.assistant_type files = assistant_document_file.find_by_assistant_mandate_and_description(mandate, document_type.TUTORING_DOCUMENT) context['files'] = files context['document_type'] = document_type.TUTORING_DOCUMENT return context
def assistant_form_view(request, mandate_id): mandate = assistant_mandate.find_mandate_by_id(mandate_id) learning_units = tutoring_learning_unit_year.find_by_mandate(mandate) phd_files = assistant_document_file.find_by_assistant_mandate_and_description( mandate, document_type.PHD_DOCUMENT) research_files = assistant_document_file.find_by_assistant_mandate_and_description( mandate, document_type.RESEARCH_DOCUMENT) tutoring_files = assistant_document_file.find_by_assistant_mandate_and_description( mandate, document_type.TUTORING_DOCUMENT) return render( request, 'manager_assistant_form_view.html', { 'mandate_id': mandate_id, 'assistant': mandate.assistant, 'mandate': mandate, 'learning_units': learning_units, 'phd_files': phd_files, 'assistant_mandate_renewal': assistant_mandate_renewal, 'research_files': research_files, 'tutoring_files': tutoring_files, 'year': mandate.academic_year.year + 1, 'assistant_type': assistant_type })
def get_context_data(self, **kwargs): context = super(AssistantLearningUnitsListView, self).get_context_data(**kwargs) mandate = assistant_mandate.find_mandate_by_assistant_for_academic_year( academic_assistant.find_by_person(self.request.user.person), academic_year.current_academic_year()) context['mandate_id'] = mandate.id context['assistant_type'] = mandate.assistant_type files = assistant_document_file.find_by_assistant_mandate_and_description( mandate, document_type.TUTORING_DOCUMENT) context['files'] = files context['document_type'] = document_type.TUTORING_DOCUMENT return context