From 7a7e26cb4abb25b9e4c03d3aa594be95bce87d2f Mon Sep 17 00:00:00 2001 From: Marcio Mazza Date: Fri, 3 Oct 2014 19:42:57 -0300 Subject: [PATCH] =?UTF-8?q?Tratamento=20de=20exce=C3=A7=C3=A3o=20para=20pe?= =?UTF-8?q?rmitir=20que=20o=20codigo=20seja=20carregado=20sem=20o=20banco?= =?UTF-8?q?=20criado?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sigi/apps/diagnosticos/admin.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sigi/apps/diagnosticos/admin.py b/sigi/apps/diagnosticos/admin.py index e1ef113..899373c 100644 --- a/sigi/apps/diagnosticos/admin.py +++ b/sigi/apps/diagnosticos/admin.py @@ -5,7 +5,7 @@ from eav.admin import BaseEntityAdmin, BaseSchemaAdmin from sigi.apps.diagnosticos.models import Diagnostico, Pergunta, Escolha, Equipe, Anexo, Categoria from sigi.apps.diagnosticos.forms import DiagnosticoForm from sigi.apps.contatos.models import UnidadeFederativa -from django.db.utils import OperationalError +from django.db.utils import OperationalError, ProgrammingError def publicar_diagnostico(self, request, queryset): @@ -78,7 +78,9 @@ class DiagnosticoAdmin(BaseEntityAdmin): 'classes': ['collapse'] }),) except OperationalError: - pass # Hack to prevent Django.db.OperationalError on migrate/syncdb at creating new database + pass # Hack to prevent Django.db.OperationalError on migrate/syncdb at creating new database + except ProgrammingError: + pass # Hack to prevent Django.db.OperationalError on migrate/syncdb at creating new database def get_uf(self, obj): return '%s' % (obj.casa_legislativa.municipio.uf)