From 0fc1b94d743f8b2e89ecbec309717d465bce52e4 Mon Sep 17 00:00:00 2001 From: Marcio Mazza Date: Mon, 4 Sep 2017 17:24:38 -0300 Subject: [PATCH] =?UTF-8?q?Verifica=20se=20norma.cod=5Fassunto=20=C3=A9=20?= =?UTF-8?q?nulo=20antes=20de=20ajustar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/legacy/migration.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sapl/legacy/migration.py b/sapl/legacy/migration.py index 06fe7e800..d7744418a 100644 --- a/sapl/legacy/migration.py +++ b/sapl/legacy/migration.py @@ -787,6 +787,9 @@ def adjust_normajuridica_antes_salvar(new, old): def adjust_normajuridica_depois_salvar(new, old): # Ajusta relação M2M + if not old.cod_assunto: # it can be null or empty + return + # lista de pks separadas por vírgulas (ignorando strings vazias) lista_pks_assunto = [int(pk) for pk in old.cod_assunto.split(',') if pk]