diff --git a/research_lines/management/urls.py b/research_lines/management/urls.py index bc047e9e..820c28e0 100644 --- a/research_lines/management/urls.py +++ b/research_lines/management/urls.py @@ -25,6 +25,10 @@ path('baseresearchlines//', base_research_line, name='base-research-line-edit'), path('baseresearchlines//delete/', base_research_line_delete, name='base-research-line-delete'), + path('baseresearchlines//teacher/new/', base_research_line_teacher_new, name='base-research-line-teacher-new'), + path('baseresearchlines//teacher//', base_research_line_teacher_edit, name='base-research-line-teacher-edit'), + path('baseresearchlines//teacher//delete/', base_research_line_teacher_delete, name='base-research-line-teacher-delete'), + path('appliedresearchlines/', applied_research_lines, name='applied-research-lines'), path('appliedresearchlines/new/', applied_research_lines_new, name='applied-research-line-new'), path('appliedresearchlines//', applied_research_line, name='applied-research-line-edit'), @@ -34,7 +38,4 @@ path('appliedresearchlines//teacher//', applied_researchline_teacher_edit, name='applied-research-line-teacher-edit'), path('appliedresearchlines//teacher//delete/', applied_researchline_teacher_delete, name='applied-research-line-teacher-delete'), - path('baseresearchlines//teacher/new/', base_research_line_teacher_new, name='base-research-line-teacher-new'), - path('baseresearchlines//teacher//', base_research_line_teacher_edit, name='base-research-line-teacher-edit'), - path('baseresearchlines//teacher//delete/', base_research_line_teacher_delete, name='base-research-line-teacher-delete'), -] + ] diff --git a/research_lines/management/views.py b/research_lines/management/views.py index 3f571ac2..99b0f805 100644 --- a/research_lines/management/views.py +++ b/research_lines/management/views.py @@ -568,10 +568,10 @@ def base_research_line_teacher_edit( RicercaDocenteLineaBase.objects.select_related("personale"), pk=teacher_rline_id ) teacher = teacher_rline.personale - teacher_rline_id = encrypt(teacher.matricola) + teacher_matricola = encrypt(teacher.matricola) teacher_data = f"{teacher.nome} {teacher.cognome}" form = RicercaDocenteLineaBaseForm( - instance=teacher_rline, initial={"choosen_person": teacher_rline_id} + instance=teacher_rline, initial={"choosen_person": teacher_matricola} ) if request.POST: @@ -579,7 +579,7 @@ def base_research_line_teacher_edit( if form.is_valid(): form.save(commit=False) teacher_rline_id = decrypt(form.cleaned_data["choosen_person"]) - new_teacher = get_object_or_404(Personale, matricola=teacher_rline_id) + new_teacher = get_object_or_404(Personale, matricola=teacher_matricola) teacher_rline.user_mod = request.user teacher_rline.personale = new_teacher teacher_rline.save() @@ -639,10 +639,10 @@ def applied_researchline_teacher_edit( pk=teacher_rline_id, ) teacher = teacher_rline.personale - teacher_rline_id = encrypt(teacher.matricola) + teacher_matricola = encrypt(teacher.matricola) teacher_data = f"{teacher.nome} {teacher.cognome}" form = RicercaDocenteLineaApplicataForm( - instance=teacher_rline, initial={"choosen_person": teacher_rline_id} + instance=teacher_rline, initial={"choosen_person": teacher_matricola} ) if request.POST: @@ -652,7 +652,7 @@ def applied_researchline_teacher_edit( if form.is_valid(): form.save(commit=False) teacher_rline_id = decrypt(form.cleaned_data["choosen_person"]) - new_teacher = get_object_or_404(Personale, matricola=teacher_rline_id) + new_teacher = get_object_or_404(Personale, matricola=teacher_matricola) teacher_rline.user_mod = request.user teacher_rline.personale = new_teacher teacher_rline.save()