diff --git a/base/urls.py b/base/urls.py index 47f66718f..e77cd643d 100644 --- a/base/urls.py +++ b/base/urls.py @@ -1,6 +1,8 @@ from django.conf.urls import url from django.views.generic.base import TemplateView +from django.contrib.staticfiles.urls import staticfiles_urlpatterns + from .views import CasaLegislativaTableAuxView, HelpView urlpatterns = [ @@ -11,3 +13,7 @@ urlpatterns = [ url(r'^casa-legislativa$', CasaLegislativaTableAuxView.as_view(), name='casa_legislativa'), ] + +# Fix a static asset finding error on Django 1.9 + gunicorn: +# http://stackoverflow.com/questions/35510373/ +urlpatterns += staticfiles_urlpatterns() diff --git a/relatorios/views.py b/relatorios/views.py index fa0e3b932..b11813364 100644 --- a/relatorios/views.py +++ b/relatorios/views.py @@ -42,7 +42,8 @@ def get_cabecalho(casa): cabecalho = {} cabecalho["nom_casa"] = casa.nome # FIXME i18n - cabecalho["nom_estado"] = "Estado de " + UF[casa.uf.upper()] + uf_dic = dict(UF) + cabecalho["nom_estado"] = "Estado de " + uf_dic[casa.uf.upper()] return cabecalho diff --git a/sapl/utils.py b/sapl/utils.py index bfa821802..f5707d197 100644 --- a/sapl/utils.py +++ b/sapl/utils.py @@ -87,7 +87,7 @@ def listify(function): return list(function(*args, **kwargs)) return f -UF = ( +UF = [ ('AC', 'Acre'), ('AL', 'Alagoas'), ('AP', 'Amapá'), @@ -116,6 +116,6 @@ UF = ( ('SP', 'São Paulo'), ('TO', 'Tocantins'), ('EX', 'Exterior'), - ) + ] RANGE_ANOS = [(year, year) for year in range(date.today().year, 1889, -1)]