Commit 444aaf16 authored by Bruno Meyer's avatar Bruno Meyer 😢
Browse files

#160: Fix broken url bug with old submissions

parent 323caa1b
Pipeline #19279 passed with stage
in 1 minute and 48 seconds
...@@ -17,7 +17,7 @@ def detail(request, submission_id, ano, semestre): ...@@ -17,7 +17,7 @@ def detail(request, submission_id, ano, semestre):
return redirect("adega:dashboard") return redirect("adega:dashboard")
for admission in get_list_admission(request.session, degree): for admission in get_list_admission(request.session, degree, submission_id):
if(admission["ano"] == ano and admission["semestre"] == semestre): if(admission["ano"] == ano and admission["semestre"] == semestre):
admission_info = admission admission_info = admission
break break
...@@ -26,7 +26,8 @@ def detail(request, submission_id, ano, semestre): ...@@ -26,7 +26,8 @@ def detail(request, submission_id, ano, semestre):
request.session, request.session,
degree, degree,
ano, ano,
semestre semestre,
submission_id
) )
for x in admission_detail: for x in admission_detail:
...@@ -51,7 +52,11 @@ def index(request, submission_id): ...@@ -51,7 +52,11 @@ def index(request, submission_id):
return redirect("adega:dashboard") return redirect("adega:dashboard")
return render(request, 'admission/index.html', { return render(request, 'admission/index.html', {
"listage_admissions": get_list_admission(request.session, degree), "listage_admissions": get_list_admission(
request.session,
degree,
submission_id
),
"degree": degree, "degree": degree,
"submission": submission "submission": submission
}) })
...@@ -15,7 +15,12 @@ def detail(request, submission_id, codigo_disciplina): ...@@ -15,7 +15,12 @@ def detail(request, submission_id, codigo_disciplina):
if not (degree in request.user.educator.degree.all()): if not (degree in request.user.educator.degree.all()):
return redirect("adega:dashboard") return redirect("adega:dashboard")
course_detail = get_course_detail(request.session, degree, codigo_disciplina) course_detail = get_course_detail(
request.session,
degree,
codigo_disciplina,
submission_id
)
return render(request, 'course/detail.html',{ return render(request, 'course/detail.html',{
"analysis_result": course_detail, "analysis_result": course_detail,
...@@ -34,7 +39,7 @@ def index(request, submission_id): ...@@ -34,7 +39,7 @@ def index(request, submission_id):
if not (degree in request.user.educator.degree.all()): if not (degree in request.user.educator.degree.all()):
return redirect("adega:dashboard") return redirect("adega:dashboard")
analysis_result = get_list_courses(request.session, degree) analysis_result = get_list_courses(request.session, degree, submission_id)
courses_list = analysis_result["cache"] courses_list = analysis_result["cache"]
code_to_name = analysis_result["disciplinas"] code_to_name = analysis_result["disciplinas"]
for code in courses_list: for code in courses_list:
......
...@@ -18,7 +18,12 @@ def detail(request, submission_id, grr): ...@@ -18,7 +18,12 @@ def detail(request, submission_id, grr):
if not (degree in request.user.educator.degree.all()): if not (degree in request.user.educator.degree.all()):
return redirect("adega:dashboard") return redirect("adega:dashboard")
cache_j = get_student_detail(request.session, degree, grr) cache_j = get_student_detail(
request.session,
degree,
grr,
submission_id
)
analysis_result = { analysis_result = {
...@@ -50,11 +55,36 @@ def index(request, submission_id): ...@@ -50,11 +55,36 @@ def index(request, submission_id):
return redirect("adega:dashboard") return redirect("adega:dashboard")
sem_evasao = get_list_students(request.session, degree, "Sem evasão") sem_evasao = get_list_students(
formatura = get_list_students(request.session, degree, "Formatura") request.session,
abandono = get_list_students(request.session, degree, "Abandono") degree,
desistencia = get_list_students(request.session, degree, "Desistência") "Sem evasão",
outros = get_list_students(request.session, degree, "Outro") submission_id
)
formatura = get_list_students(
request.session,
degree,
"Formatura",
submission_id
)
abandono = get_list_students(
request.session,
degree,
"Abandono",
submission_id
)
desistencia = get_list_students(
request.session,
degree,
"Desistência",
submission_id
)
outros = get_list_students(
request.session,
degree,
"Outro",
submission_id
)
return render(request, 'student/index.html', { return render(request, 'student/index.html', {
'degree': degree, 'degree': degree,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment