From e314f47f5dfc4676adc7e2feeb00957bfe29993a Mon Sep 17 00:00:00 2001 From: Luciano Almeida Date: Tue, 8 Aug 2017 13:45:10 -0300 Subject: [PATCH] Verifica data de fim da comissao para definir status ativo Signed-off-by: Luciano Almeida --- sapl/legacy/migration.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sapl/legacy/migration.py b/sapl/legacy/migration.py index 183b22dbd..fcf2f0837 100644 --- a/sapl/legacy/migration.py +++ b/sapl/legacy/migration.py @@ -898,13 +898,13 @@ def adjust_autor(new, old): def adjust_comissao(new, old): - if old.dat_extincao: - if date.today() < new.data_extincao: - new.ativa = True - else: - new.ativa = False - if not old.dat_extincao: + if not old.dat_extincao and not old.dat_fim_comissao: + new.ativa = True + elif old.dat_extincao and date.today() < new.data_extincao or \ + old.dat_fim_comissao and date.today() < new.data_fim_comissao: new.ativa = True + else: + new.ativa = False AJUSTE_ANTES_SALVAR = {