From e520ec16724571c989b814a6c9c63bb5bd927dd8 Mon Sep 17 00:00:00 2001 From: Marcio Mazza Date: Wed, 31 Jan 2018 17:23:04 -0200 Subject: [PATCH] =?UTF-8?q?Adapta=20migra=C3=A7=C3=A3o=20p=20municipio=20e?= =?UTF-8?q?=20uf=20em=20Parlamentar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/legacy/migration.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sapl/legacy/migration.py b/sapl/legacy/migration.py index a3562783a..0a5bd0ea6 100644 --- a/sapl/legacy/migration.py +++ b/sapl/legacy/migration.py @@ -789,6 +789,13 @@ def adjust_parlamentar(new, old): if value is None: warn('nulo convertido para falso') new.unidade_deliberativa = False + # migra municĂ­pio de residĂȘncia + if old.cod_localidade_resid: + municipio_uf = list(exec_legado(''' + select nom_localidade, sgl_uf from localidade + where cod_localidade = {}'''.format(old.cod_localidade_resid))) + if municipio_uf: + new.municipio_residencia, new.uf_residencia = municipio_uf[0] def adjust_participacao(new, old):