From c9d65a5146da83eb0ce51734fad93e9b48752751 Mon Sep 17 00:00:00 2001 From: Marcio Mazza Date: Sun, 16 Jun 2019 12:38:09 +0200 Subject: [PATCH] =?UTF-8?q?Corrige=20revert=5Fdelete=5Fproducao=20p=20caso?= =?UTF-8?q?=20de=20autor=20sem=20conte=C3=BAdo=20relacionado?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/legacy/migracao_dados.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sapl/legacy/migracao_dados.py b/sapl/legacy/migracao_dados.py index 639630fe4..6bb10fd15 100644 --- a/sapl/legacy/migracao_dados.py +++ b/sapl/legacy/migracao_dados.py @@ -1938,7 +1938,7 @@ def revert_delete_producao(dados_versions): assert reverted # restauramos objetos relacinados ao autor # teoricamente precisaríamos fazer isso pra todas as generic relations - if isinstance(reverted, Autor): + if isinstance(reverted, Autor) and reverted.content_type: apagados_relacionados = Version.objects.get_deleted( reverted.content_type.model_class() )