Exemple #1
0
def dissertations(request):
    person = mdl.person.find_by_user(request.user)

    if mdl.student.find_by_person(person) and not \
            mdl.tutor.find_by_person(person) and not \
            adviser.find_by_person(person):
            return redirect('home')

    elif adviser.find_by_person(person):
        adv = adviser.search_by_person(person)
        count_advisers_pro_request = dissertation_role.count_by_adviser(adv, 'PROMOTEUR', 'DIR_SUBMIT')

        return layout.render(request, "dissertations.html",
                             {'section': 'dissertations',
                              'person': person,
                              'adviser': adv,
                              'count_advisers_pro_request': count_advisers_pro_request})
    else:
        if request.method == "POST":
            form = AdviserForm(request.POST)
            if form.is_valid():
                adv = Adviser(person=person, available_by_email=False, available_by_phone=False,
                              available_at_office=False)
                adv.save()
                adv = adviser.search_by_person(person)
                count_advisers_pro_request = dissertation_role.count_by_adviser(adv, 'PROMOTEUR', 'DIR_SUBMIT')

                return layout.render(request, "dissertations.html",
                                     {'section': 'dissertations',
                                      'person': person,
                                      'adviser': adv,
                                      'count_advisers_pro_request': count_advisers_pro_request})
        else:
            form = AdviserForm()
            return layout.render(request, 'dissertations_welcome.html', {'form': form})
Exemple #2
0
def manager_dissertations_jury_new_ajax(request):
    pk_dissert = request.POST.get("pk_dissertation", '')
    status_choice = request.POST.get("status_choice", '')
    id_adviser_of_dissert_role = request.POST.get("adviser_pk", '')
    if not id_adviser_of_dissert_role or not status_choice or not pk_dissert:
        return HttpResponse(status=ERROR_405_BAD_REQUEST)
    else:
        dissert = dissertation.find_by_id(pk_dissert)
        adviser_of_dissert_role = adviser.get_by_id(
            int(id_adviser_of_dissert_role))
        count_dissertation_role = dissertation_role.count_by_dissertation(
            dissert)
        person = mdl.person.find_by_user(request.user)
        adv_manager = adviser.search_by_person(person)
        if adviser_can_manage(dissert, adv_manager) and count_dissertation_role < 4 and dissert.status != 'DRAFT' \
                and adviser_of_dissert_role is not None and dissert is not None:
            justification = "%s %s %s" % ("manager_add_jury", status_choice,
                                          adviser_of_dissert_role)
            dissertation_update.add(request,
                                    dissert,
                                    dissert.status,
                                    justification=justification)
            dissertation_role.add(status_choice, adviser_of_dissert_role,
                                  dissert)
            return HttpResponse(status=HTTP_OK)
        else:
            return HttpResponse(status=ERROR_403_NOT_FORBIDDEN)
Exemple #3
0
def manager_offer_parameters(request):
    person = mdl.person.find_by_user(request.user)
    adv = adviser.search_by_person(person)
    offers = faculty_adviser.search_by_adviser(adv)
    offer_props = offer_proposition.search_by_offer(offers)
    return layout.render(request, 'manager_offer_parameters.html',
                         {'offer_propositions': offer_props})
Exemple #4
0
def dissertations_search(request):
    person = mdl.person.find_by_user(request.user)
    adv = adviser.search_by_person(person)
    disserts = dissertation.search_by_proposition_author(terms=request.GET['search'],
                                                         active=True,
                                                         proposition_author=adv)
    return layout.render(request, "dissertations_list.html", {'dissertations': disserts})
Exemple #5
0
def dissertations_to_dir_ko(request, pk):
    dissert = dissertation.find_by_id(pk)
    if dissert is None:
        return redirect('dissertations_list')
    person = mdl.person.find_by_user(request.user)
    adv = adviser.search_by_person(person)

    if teacher_is_promotor(adv, dissert):
        old_status = dissert.status
        new_status = dissertation.get_next_status(dissert, "refuse")
        status_dict = dict(dissertation.STATUS_CHOICES)
        new_status_display = status_dict[new_status]

        if request.method == "POST":
            form = ManagerDissertationUpdateForm(request.POST)
            if form.is_valid():
                dissert.refuse()
                data = form.cleaned_data
                justification = data['justification']
                dissertation_update.add(request, dissert, old_status, justification=justification)
                return redirect('dissertations_detail', pk=pk)

        else:
            form = ManagerDissertationUpdateForm()

        return layout.render(request, 'dissertations_add_justification.html',
                             {'form': form, 'dissert': dissert, 'new_status_display': new_status_display})

    else:
        return redirect('dissertations_detail', pk=pk)
Exemple #6
0
def manager_dissertations_edit(request, pk):
    dissert = dissertation.find_by_id(pk)
    if dissert is None:
        return redirect('manager_dissertations_list')
    person = mdl.person.find_by_user(request.user)
    adv = adviser.search_by_person(person)
    if adviser_can_manage(dissert,adv):
        offers = faculty_adviser.search_by_adviser(adv)
        if request.method == "POST":
            form = ManagerDissertationEditForm(request.POST, instance=dissert)
            if form.is_valid():
                dissert = form.save()
                justification = "manager_edit_dissertation"
                dissertation_update.add(request, dissert, dissert.status, justification=justification)
                return redirect('manager_dissertations_detail', pk=dissert.pk)
            else:
                form.fields["proposition_dissertation"].queryset = proposition_dissertation.search_by_offers(offers)
                form.fields["author"].queryset = mdl.student.find_by_offer(offers)
                form.fields["offer_year_start"].queryset = mdl.offer_year.find_by_offer(offers)
        else:
            form = ManagerDissertationEditForm(instance=dissert)
            form.fields["proposition_dissertation"].queryset = proposition_dissertation.search_by_offers(offers)
            form.fields["author"].queryset = mdl.student.find_by_offer(offers)
            form.fields["offer_year_start"].queryset = mdl.offer_year.find_by_offer(offers)

        return layout.render(request, 'manager_dissertations_edit.html',
                             {'form': form,
                              'dissert': dissert,
                              'defend_periode_choices': dissertation.DEFEND_PERIODE_CHOICES})
    else:
        return redirect('manager_dissertations_list')
Exemple #7
0
def manager_dissertations_jury_new(request, pk):
    dissert = dissertation.find_by_id(pk)
    if dissert is None:
        return redirect('manager_dissertations_list')
    count_dissertation_role = dissertation_role.count_by_dissertation(dissert)
    person = mdl.person.find_by_user(request.user)
    adv = adviser.search_by_person(person)
    if adviser_can_manage(dissert,adv):
        if count_dissertation_role < 4 and dissert.status != 'DRAFT':
            if request.method == "POST":
                form = ManagerDissertationRoleForm(request.POST)
                if form.is_valid():
                    data = form.cleaned_data
                    status = data['status']
                    adv = data['adviser']
                    diss = data['dissertation']
                    justification = "%s %s %s" % ("manager_add_jury", str(status), str(adv))
                    dissertation_update.add(request, dissert, dissert.status, justification=justification)
                    dissertation_role.add(status, adv, diss)
                    return redirect('manager_dissertations_detail', pk=dissert.pk)
                else:
                    form = ManagerDissertationRoleForm(initial={'dissertation': dissert})
            else:
                form = ManagerDissertationRoleForm(initial={'dissertation': dissert})
            return layout.render(request, 'manager_dissertations_jury_edit.html', {'form': form, 'dissert': dissert})
        else:
            return redirect('manager_dissertations_detail', pk=dissert.pk)

    else:
        return redirect('manager_dissertations_list')
Exemple #8
0
def dissertations_jury_new(request, pk):
    dissert = dissertation.find_by_id(pk)
    if dissert is None:
        return redirect('dissertations_list')
    person = mdl.person.find_by_user(request.user)
    adv = adviser.search_by_person(person)
    offer_prop = offer_proposition.get_by_dissertation(dissert)
    if offer_prop is not None and teacher_is_promotor(adv, dissert):
        count_dissertation_role = dissertation_role.count_by_dissertation(dissert)
        if count_dissertation_role < 4 and offer_prop.adviser_can_suggest_reader:
            if request.method == "POST":
                form = ManagerDissertationRoleForm(request.POST)
                if form.is_valid():
                    data = form.cleaned_data
                    status = data['status']
                    adv = data['adviser']
                    diss = data['dissertation']
                    justification = "%s %s %s" % ("teacher_add_jury", str(status), str(adv))
                    dissertation_update.add(request, dissert, dissert.status, justification=justification)
                    dissertation_role.add(status, adv, diss)
                    return redirect('dissertations_detail', pk=dissert.pk)
                else:
                    form = ManagerDissertationRoleForm(initial={'dissertation': dissert})
            else:
                form = ManagerDissertationRoleForm(initial={'dissertation': dissert})
            return layout.render(request, 'dissertations_jury_edit.html', {'form': form, 'dissert': dissert})

    return redirect('dissertations_detail', pk=dissert.pk)
Exemple #9
0
def dissertations_wait_list(request):
    person = mdl.person.find_by_user(request.user)
    adv = adviser.search_by_person(person)
    roles_list_dissertations = dissertation_role.search_by_adviser_and_role_and_status(adv, "PROMOTEUR", "DIR_SUBMIT")

    return layout.render(request, 'dissertations_wait_list.html',
                         {'roles_list_dissertations': roles_list_dissertations})
Exemple #10
0
def manager_dissertations_jury_new_ajax(request):
    pk_dissert = request.POST.get("pk_dissertation", '')
    status_choice = request.POST.get("status_choice", '')
    id_adviser_of_dissert_role = request.POST.get("adviser_pk", '')
    if not id_adviser_of_dissert_role or not status_choice or not pk_dissert:
        return HttpResponse(status=status.HTTP_405_METHOD_NOT_ALLOWED)
    else:
        dissert = dissertation.find_by_id(pk_dissert)
        adviser_of_dissert_role = adviser.get_by_id(
            int(id_adviser_of_dissert_role))
        count_dissertation_role = dissertation_role.count_by_dissertation(
            dissert)
        person = mdl.person.find_by_user(request.user)
        adv_manager = adviser.search_by_person(person)
        if adviser_can_manage(dissert, adv_manager) \
                and count_dissertation_role < MAX_DISSERTATION_ROLE_FOR_ONE_DISSERTATION and dissert.status != 'DRAFT' \
                and adviser_of_dissert_role is not None and dissert is not None:
            justification = "%s %s %s" % (_("Manager add jury"), status_choice,
                                          adviser_of_dissert_role)
            dissertation_update.add(request,
                                    dissert,
                                    dissert.status,
                                    justification=justification)
            dissertation_role.add(status_choice, adviser_of_dissert_role,
                                  dissert)
            return HttpResponse(status=status.HTTP_200_OK)
        else:
            return HttpResponse(status=status.HTTP_403_FORBIDDEN)
Exemple #11
0
def dissertations_detail(request, pk):
    dissert = dissertation.find_by_id(pk)
    if dissert is None:
        return redirect('dissertations_list')
    person = mdl.person.find_by_user(request.user)
    adv = adviser.search_by_person(person)

    if teacher_can_see_dissertation(adv, dissert):
        count_dissertation_role = dissertation_role.count_by_dissertation(dissert)
        offer_prop = offer_proposition.get_by_dissertation(dissert)
        if offer_prop is None:
            return redirect('dissertations_list')

        promotors_count = dissertation_role.count_by_status_dissertation('PROMOTEUR', dissert)

        files = dissertation_document_file.find_by_dissertation(dissert)
        filename = ""
        for file in files:
            filename = file.document_file.file_name

        dissertation_roles = dissertation_role.search_by_dissertation(dissert)
        return layout.render(request, 'dissertations_detail.html',
                             {'dissertation': dissert,
                              'adviser': adv,
                              'dissertation_roles': dissertation_roles,
                              'count_dissertation_role': count_dissertation_role,
                              'offer_prop': offer_prop,
                              'promotors_count': promotors_count,
                              'teacher_is_promotor': teacher_is_promotor(adv, dissert),
                              'filename': filename})
    else:
        return redirect('dissertations_list')
def manager_dissertations_to_dir_ok(request, pk):
    dissert = dissertation.find_by_id(pk)
    redirect_if_none(dissert, 'manager_dissertations_list')
    person = mdl.person.find_by_user(request.user)
    adv = adviser.search_by_person(person)
    if (adviser_can_manage(dissert, adv)):
        old_status = dissert.status
        new_status = dissertation.get_next_status(dissert, "accept")
        status_dict = dict(dissertation.STATUS_CHOICES)
        new_status_display = status_dict[new_status]

        if request.method == "POST":
            form = ManagerDissertationUpdateForm(request.POST)
            if form.is_valid():
                dissert.manager_accept()
                data = form.cleaned_data
                justification = data['justification']
                dissertation_update.add(request, dissert, old_status, justification=justification)
                return redirect('manager_dissertations_detail', pk=pk)

        else:
            form = ManagerDissertationUpdateForm()

        return layout.render(request, 'manager_dissertations_add_justification.html',
                             {'form': form, 'dissert': dissert, 'new_status_display': new_status_display})
    else:
        return redirect('manager_dissertations_list')
Exemple #13
0
def manager_proposition_dissertation_detail(request, pk):
    proposition = proposition_dissertation.find_by_id(pk)
    if proposition is None:
        return redirect('manager_proposition_dissertations')
    offer_propositions = proposition_offer.find_by_proposition_dissertation(proposition)
    person = mdl.person.find_by_user(request.user)
    adv = adviser.search_by_person(person)
    count_use = dissertation.count_by_proposition(proposition)
    percent = count_use * 100 / proposition.max_number_student if proposition.max_number_student else 0
    count_proposition_role = proposition_role.count_by_proposition(proposition)
    files = proposition_document_file.find_by_proposition(proposition)
    filename = ""
    for file in files:
        filename = file.document_file.file_name
    if count_proposition_role < 1:
        proposition_role.add('PROMOTEUR', proposition.author, proposition)
    proposition_roles = proposition_role.search_by_proposition(proposition)
    return layout.render(request, 'manager_proposition_dissertation_detail.html',
                         {'proposition_dissertation': proposition,
                          'offer_propositions': offer_propositions,
                          'adviser': adv,
                          'count_use': count_use,
                          'percent': round(percent, 2),
                          'proposition_roles': proposition_roles,
                          'count_proposition_role': count_proposition_role,
                          'filename': filename})
Exemple #14
0
def manager_proposition_dissertations(request):
    person = mdl.person.find_by_user(request.user)
    adv = adviser.search_by_person(person)
    offers = faculty_adviser.search_by_adviser(adv)
    propositions_dissertations = proposition_dissertation.search_by_offers(offers)
    return layout.render(request, 'manager_proposition_dissertations_list.html',
                         {'propositions_dissertations': propositions_dissertations})
def manager_offer_parameters(request):
    person = mdl.person.find_by_user(request.user)
    adv = adviser.search_by_person(person)
    education_groups = faculty_adviser.find_education_groups_by_adviser(adv)
    offer_props = offer_proposition.search_by_education_group(education_groups)
    return render(request, 'manager_offer_parameters.html',
                  {'offer_propositions': offer_props})
def informations(request):
    person = mdl.person.find_by_user(request.user)
    adv = adviser.search_by_person(person)
    return layout.render(
        request, "informations.html", {
            'adviser': adv,
            'first_name': adv.person.first_name.title(),
            'last_name': adv.person.last_name.title()
        })
def manager_informations_list_request(request):
    person = mdl.person.find_by_user(request.user)
    adv = adviser.search_by_person(person)
    offers = faculty_adviser.search_by_adviser(adv)
    advisers_need_request = dissertation_role.list_teachers_action_needed(
        offers)

    return layout.render(request, "manager_informations_list_request.html",
                         {'advisers_need_request': advisers_need_request})
Exemple #18
0
def manager_dissertations_search(request):
    person = mdl.person.find_by_user(request.user)
    adv = adviser.search_by_person(person)
    offers = faculty_adviser.search_by_adviser(adv)
    disserts = dissertation.search(terms=request.GET.get('search', ''),
                                   active=True)
    disserts = disserts.filter(offer_year_start__offer__in=offers)
    offer_prop_search = request.GET.get('offer_prop_search', '')
    academic_year_search = request.GET.get('academic_year', '')
    status_search = request.GET.get('status_search', '')

    if offer_prop_search != '':
        offer_prop_search = int(offer_prop_search)
        offer_prop = offer_proposition.find_by_id(offer_prop_search)
        disserts = disserts.filter(offer_year_start__offer=offer_prop.offer)
    if academic_year_search != '':
        academic_year_search = int(academic_year_search)
        disserts = disserts.filter(
            offer_year_start__academic_year=academic_year.
            find_academic_year_by_id(academic_year_search))
    if status_search != '':
        disserts = disserts.filter(status=status_search)
    offer_props = offer_proposition.search_by_offer(offers)
    show_validation_commission = offer_proposition.show_validation_commission(
        offer_props)
    show_evaluation_first_year = offer_proposition.show_evaluation_first_year(
        offer_props)
    start_date = timezone.now().replace(year=timezone.now().year - 10)
    end_date = timezone.now().replace(year=timezone.now().year + 1)
    academic_year_10y = academic_year.find_academic_years(end_date, start_date)

    if 'bt_xlsx' in request.GET:
        xls = generate_xls(disserts)
        filename = 'dissertations_{}.xlsx'.format(
            time.strftime("%Y-%m-%d_%H:%M"))
        response = HttpResponse(
            xls,
            content_type=
            'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
        )
        response['Content-Disposition'] = "%s%s" % ("attachment; filename=",
                                                    filename)
        return response

    else:
        return layout.render(
            request, "manager_dissertations_list.html", {
                'dissertations': disserts,
                'show_validation_commission': show_validation_commission,
                'show_evaluation_first_year': show_evaluation_first_year,
                'academic_year_10y': academic_year_10y,
                'offer_props': offer_props,
                'offer_prop_search': offer_prop_search,
                'academic_year_search': academic_year_search,
                'status_search': status_search
            })
Exemple #19
0
def manager_dissertations_role_delete_by_ajax(request, pk):
    dissert_role = get_object_or_404(DissertationRole,pk=pk)
    dissert = dissert_role.dissertation
    person = mdl.person.find_by_user(request.user)
    adv = adviser.search_by_person(person)
    if adviser_can_manage(dissert, adv) and \
            _justification_dissert_role_delete_change(request, dissert, dissert_role, "manager_delete_jury"):
        return HttpResponse(HTTP_OK)
    else:
        return redirect('manager_dissertations_list')
Exemple #20
0
def manager_students_list(request):

    current_manager = adviser.search_by_person(
        mdl.person.find_by_user(request.user))
    offers = faculty_adviser.search_by_adviser(current_manager)
    students = mdl.student.find_by_offers_and_academic_year(offers, mdl.academic_year.starting_academic_year())\
        .prefetch_related('dissertation_set', 'offerenrollment_set')

    return layout.render(request, 'manager_students_list.html',
                         {'students': students})
def manager_dissertations_detail_updates(request, pk):
    dissert = dissertation.find_by_id(pk)
    redirect_if_none(dissert, 'manager_dissertations_list')
    person = mdl.person.find_by_user(request.user)
    adv = adviser.search_by_person(person)
    dissertation_updates = dissertation_update.search_by_dissertation(dissert)

    return layout.render(request, 'manager_dissertations_detail_updates.html',
                         {'dissertation': dissert,
                          'adviser': adv,
                          'dissertation_updates': dissertation_updates})
def dissertations_delete(request, pk):
    dissert = dissertation.find_by_id(pk)
    redirect_if_none(dissert, 'dissertations_list')
    person = mdl.person.find_by_user(request.user)
    adv = adviser.search_by_person(person)
    if teacher_is_promotor(adv, dissert):
        dissert.deactivate()
        dissertation_update.add(request, dissert, dissert.status, justification="teacher_set_active_false ")
        return redirect('dissertations_list')
    else:
        return redirect('dissertations_detail', pk=pk)
Exemple #23
0
def dissertations_list(request):
    person = mdl.person.find_by_user(request.user)
    adv = adviser.search_by_person(person)
    adviser_list_dissertations = dissertation_role.search_by_adviser_and_role(adv, 'PROMOTEUR')
    adviser_list_dissertations_copro = dissertation_role.search_by_adviser_and_role(adv, 'CO_PROMOTEUR')
    adviser_list_dissertations_reader = dissertation_role.search_by_adviser_and_role(adv, 'READER')
    adviser_list_dissertations_accompanist = dissertation_role.search_by_adviser_and_role(adv, 'ACCOMPANIST')
    adviser_list_dissertations_internship = dissertation_role.search_by_adviser_and_role(adv, 'INTERNSHIP')
    adviser_list_dissertations_president = dissertation_role.search_by_adviser_and_role(adv, 'PRESIDENT')

    return layout.render(request, "dissertations_list.html", locals())
def manager_dissertations_delete(request, pk):
    dissert = dissertation.find_by_id(pk)
    redirect_if_none(dissert,'manager_dissertations_list')
    person = mdl.person.find_by_user(request.user)
    adv = adviser.search_by_person(person)
    if (adviser_can_manage(dissert, adv)):
        dissert.deactivate()
        dissertation_update.add(request, dissert, dissert.status, justification="manager_set_active_false")

        return redirect('manager_dissertations_list')
    else:
        return redirect('manager_dissertations_list')
Exemple #25
0
def manager_dissertations_role_delete(request, pk):
    dissert_role = dissertation_role.find_by_id(pk)
    if dissert_role is None:
        return redirect('manager_dissertations_list')
    dissert = dissert_role.dissertation
    person = mdl.person.find_by_user(request.user)
    adv = adviser.search_by_person(person)
    if adviser_can_manage(dissert, adv) and \
            _justification_dissert_role_delete_change(request, dissert, dissert_role, _("Manager deleted jury")):
        return redirect('manager_dissertations_detail', pk=dissert.pk)
    else:
        return redirect('manager_dissertations_list')
Exemple #26
0
def manager_dissertations_wait_recep_list(request):
    person = mdl.person.find_by_user(request.user)
    adv = adviser.search_by_person(person)
    offers = faculty_adviser.search_by_adviser(adv)
    offer_props = offer_proposition.search_by_offer(offers)
    show_validation_commission = offer_proposition.show_validation_commission(offer_props)
    show_evaluation_first_year = offer_proposition.show_evaluation_first_year(offer_props)
    disserts = dissertation.search_by_offer_and_status(offers, "TO_RECEIVE")

    return layout.render(request, 'manager_dissertations_wait_recep_list.html',
                         {'dissertations': disserts,
                          'show_validation_commission': show_validation_commission,
                          'show_evaluation_first_year': show_evaluation_first_year})
Exemple #27
0
def manager_dissertations_wait_comm_list(request):
    person = mdl.person.find_by_user(request.user)
    adv = adviser.search_by_person(person)
    offers = faculty_adviser.search_by_adviser(adv)
    offer_props = offer_proposition.search_by_offer(offers)
    all_advisers_array = str(adviser.convert_advisers_to_array(adviser.find_all_advisers()))
    show_validation_commission = offer_proposition.show_validation_commission(offer_props)
    show_evaluation_first_year = offer_proposition.show_evaluation_first_year(offer_props)
    return layout.render(request, 'manager_dissertations_wait_commission_list.html',
                         {'show_validation_commission': show_validation_commission,
                          'STATUS_CHOICES': STATUS_CHOICES,
                          'show_evaluation_first_year': show_evaluation_first_year,
                          'all_advisers_array': all_advisers_array})
def manager_dissertations_accept_eval_list(request, pk):
    dissert = dissertation.find_by_id(pk)
    redirect_if_none(dissert, 'manager_dissertations_list')
    person = mdl.person.find_by_user(request.user)
    adv = adviser.search_by_person(person)
    if (adviser_can_manage(dissert, adv)):
        old_status = dissert.status
        dissert.manager_accept()
        dissertation_update.add(request, dissert, old_status)

        return redirect('manager_dissertations_wait_eval_list')
    else:
        return redirect('manager_dissertations_wait_eval_list')
def dissertations_detail_updates(request, pk):
    dissert = dissertation.find_by_id(pk)
    redirect_if_none(dissert, 'dissertations_list')
    person = mdl.person.find_by_user(request.user)
    adv = adviser.search_by_person(person)
    if teacher_is_promotor(adv, dissert):
        dissertation_updates = dissertation_update.search_by_dissertation(dissert)
        return layout.render(request, 'dissertations_detail_updates.html',
                             {'dissertation': dissert,
                              'adviser': adv,
                              'dissertation_updates': dissertation_updates})
    else:
        return redirect('dissertations_list')
def dissertations_role_delete(request, pk):
    dissert_role = dissertation_role.find_by_id(pk)
    redirect_if_none(dissert_role,'dissertations_list')
    dissert = dissert_role.dissertation
    person = mdl.person.find_by_user(request.user)
    adv = adviser.search_by_person(person)
    offer_prop = offer_proposition.get_by_dissertation(dissert)
    if offer_prop is not None and teacher_is_promotor(adv, dissert):
        if offer_prop.adviser_can_suggest_reader and role_can_be_deleted(dissert, dissert_role):
            justification = "%s %s" % ("teacher_delete_jury", str(dissert_role))
            dissertation_update.add(request, dissert, dissert.status, justification=justification)
            dissert_role.delete()

    return redirect('dissertations_detail', pk=dissert.pk)