Browse Source

Merge branch 'stable/2.2' of github.com:interlegis/sigi into new_sigi

pull/102/head
Lude Ribeiro 3 years ago
parent
commit
58d321915b
  1. 4
      sigi/apps/casas/views.py

4
sigi/apps/casas/views.py

@ -2,6 +2,7 @@
import csv import csv
from datetime import datetime from datetime import datetime
from functools import reduce from functools import reduce
from sigi.apps.utils import to_ascii
from geraldo.generators import PDFGenerator from geraldo.generators import PDFGenerator
from django.conf import settings from django.conf import settings
@ -257,9 +258,10 @@ class importa_casas(View):
for reg in reader: for reg in reader:
self.total_registros += 1 self.total_registros += 1
reg[self.ERROS] = [] reg[self.ERROS] = []
nome_orgao = to_ascii(reg[self.MUNICIPIO])
orgao = Orgao.objects.filter( orgao = Orgao.objects.filter(
tipo__sigla=reg[self.TIPO], tipo__sigla=reg[self.TIPO],
municipio__nome=reg[self.MUNICIPIO], municipio__search_text__icontains=nome_orgao,
municipio__uf__sigla=reg[self.UF] municipio__uf__sigla=reg[self.UF]
) )
if orgao.count() == 0: if orgao.count() == 0:

Loading…
Cancel
Save