From ed7b1d4ee310a4c3054df7428fcf3248da20ebc6 Mon Sep 17 00:00:00 2001 From: LeandroJatai Date: Mon, 24 Oct 2022 16:32:45 -0300 Subject: [PATCH] HOT-FIX: corrige carga de Content Type Choice --- sapl/materia/forms.py | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/sapl/materia/forms.py b/sapl/materia/forms.py index 1af4b7aa9..848314735 100644 --- a/sapl/materia/forms.py +++ b/sapl/materia/forms.py @@ -1490,15 +1490,18 @@ class TramitacaoEmLoteFilterSet(django_filters.FilterSet): class TipoProposicaoForm(ModelForm): - content_types_choices = [ - ( - f'{ct.app_label}/{ct.model}', - ct - ) - for k, ct in ContentType.objects.get_for_models( - *models_with_gr_for_model(TipoProposicao) - ).items() - ] + try: + content_types_choices = [ + ( + f'{ct.app_label}/{ct.model}', + ct + ) + for k, ct in ContentType.objects.get_for_models( + *models_with_gr_for_model(TipoProposicao) + ).items() + ] + except: + content_types_choices = [] logger = logging.getLogger(__name__)