From 16688a3b5be895995468cd9bcdca65307f4a93ae Mon Sep 17 00:00:00 2001 From: Sesostris Vieira Date: Fri, 19 Oct 2012 11:06:03 +0000 Subject: [PATCH] =?UTF-8?q?Adapta=C3=A7=C3=A3o=20para=20atender=20a=20alte?= =?UTF-8?q?ra=C3=A7=C3=A3o=20introduzida=20no=20Django=201.2.4=20descrita?= =?UTF-8?q?=20em=20https://www.djangoproject.com/weblog/2010/dec/22/securi?= =?UTF-8?q?ty/=20item=20'Information=20leakage=20in=20Django=20administrat?= =?UTF-8?q?ive=20interface'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sigi/apps/casas/admin.py | 5 +++++ sigi/apps/servicos/admin.py | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/sigi/apps/casas/admin.py b/sigi/apps/casas/admin.py index 65aa5fe..b0ed55d 100644 --- a/sigi/apps/casas/admin.py +++ b/sigi/apps/casas/admin.py @@ -77,6 +77,11 @@ class CasaLegislativaAdmin(admin.ModelAdmin): request, extra_context={'query_str': '?' + request.META['QUERY_STRING']} ) + + def lookup_allowed(self, lookup, value): + return super(CasaLegislativaAdmin, self).lookup_allowed(lookup, value) or \ + lookup in ['municipio__uf__codigo_ibge__exact'] + def etiqueta(self,request,queryset): return labels_report(request,queryset=queryset) diff --git a/sigi/apps/servicos/admin.py b/sigi/apps/servicos/admin.py index 06027ef..4061729 100644 --- a/sigi/apps/servicos/admin.py +++ b/sigi/apps/servicos/admin.py @@ -130,6 +130,10 @@ class CasaAtendidaAdmin(admin.ModelAdmin): search_fields = ('search_text','cnpj', 'bairro', 'logradouro', 'cep', 'municipio__nome', 'municipio__uf__nome', 'municipio__codigo_ibge', 'pagina_web', 'observacoes') + + def lookup_allowed(self, lookup, value): + return super(CasaAtendidaAdmin, self).lookup_allowed(lookup, value) or \ + lookup in ['municipio__uf__codigo_ibge__exact'] def change_view(self, request, object_id, extra_context=None): # Se a Casa ainda não é atendida, gerar o código interlegis para ela