From 8e9d911eec0d50228961ed00f22318a5d76dbcce Mon Sep 17 00:00:00 2001 From: Luciano Henrique Nunes de Almeida Date: Fri, 15 Sep 2017 14:07:54 -0300 Subject: [PATCH] =?UTF-8?q?Concerta=20data=20de=20fim=20de=20mandato=20na?= =?UTF-8?q?=20migra=C3=A7=C3=A3o=20(#1484)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Luciano Almeida --- sapl/legacy/migration.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sapl/legacy/migration.py b/sapl/legacy/migration.py index b03514366..2d586c326 100644 --- a/sapl/legacy/migration.py +++ b/sapl/legacy/migration.py @@ -424,9 +424,9 @@ def adjust_mandato(new, old): if old.dat_fim_mandato: new.data_fim_mandato = old.dat_fim_mandato if not new.data_fim_mandato: - legislatura = Legislatura.objects.latest('data_fim') - new.data_fim_mandato = legislatura.data_fim - new.data_expedicao_diploma = legislatura.data_inicio + new.data_fim_mandato = new.legislatura.data_fim + if not new.data_inicio_mandato: + new.data_inicio_mandato = new.legislatura.data_inicio def adjust_ordemdia_antes_salvar(new, old):