From c81c494ab4e81ce5ff2bc77e2de3d56b3d814890 Mon Sep 17 00:00:00 2001 From: Marcio Mazza Date: Fri, 9 Feb 2018 12:46:01 -0200 Subject: [PATCH] =?UTF-8?q?Corrige=20pre-migra=C3=A7=C3=A3o=20de=20tipos?= =?UTF-8?q?=20de=20origem=20externa?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/legacy/migration.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sapl/legacy/migration.py b/sapl/legacy/migration.py index 49d84ec17..4ad65ffa9 100644 --- a/sapl/legacy/migration.py +++ b/sapl/legacy/migration.py @@ -316,10 +316,11 @@ def anula_tipos_origem_externa_invalidos(): from tipo_materia_legislativa where ind_excluido <> 1;'''))) - exec_legado(''' - update materia_legislativa - set tip_origem_externa = NULL - where tip_origem_externa not in {};'''.format(tipos_validos)) + if tipos_validos: + exec_legado(''' + update materia_legislativa + set tip_origem_externa = NULL + where tip_origem_externa not in {};'''.format(tipos_validos)) def uniformiza_banco():