From 7e2341ac78da87b58d9e56f95a8a4235b99fe907 Mon Sep 17 00:00:00 2001 From: Edward Date: Wed, 9 May 2018 18:18:49 -0300 Subject: [PATCH] Fixes #1931 (#1932) --- sapl/materia/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sapl/materia/views.py b/sapl/materia/views.py index a23932b42..74f2bd6b6 100644 --- a/sapl/materia/views.py +++ b/sapl/materia/views.py @@ -937,7 +937,8 @@ class RelatoriaCrud(MasterDetailCrud): except ObjectDoesNotExist: pass else: - composicao = comissao.composicao_set.last() + composicao = comissao.composicao_set.order_by( + '-periodo__data_inicio').first() participacao = Participacao.objects.filter( composicao=composicao)